mirror of https://github.com/llvm/torch-mlir
Fix issue with float_attr.
parent
f67c5a42dc
commit
28048337ae
|
@ -5,7 +5,7 @@
|
|||
import string
|
||||
import sys
|
||||
|
||||
_ENABLED = False
|
||||
_ENABLED = True
|
||||
_formatter = string.Formatter()
|
||||
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@ def binary_expression():
|
|||
a = 1
|
||||
b = 100
|
||||
c = a * b + 4
|
||||
c = c * 2.0
|
||||
return c
|
||||
|
||||
fe = ImportFrontend()
|
||||
|
|
|
@ -437,7 +437,7 @@ void PyContext::bind(py::module m) {
|
|||
},
|
||||
py::arg("type"), py::arg("value"))
|
||||
.def("float_attr",
|
||||
[](PyContext &self, PyType type, double value) {
|
||||
[](PyContext &self, PyType type, double value) -> PyAttribute {
|
||||
if (!type.type.isa<FloatType>()) {
|
||||
throw py::raiseValueError("Expected FloatType");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue