Skip to content

Commit

Permalink
[TIR] Add conversion from FloatImm to float in Python (apache#9009)
Browse files Browse the repository at this point in the history
This method matches the IntImm method for converting from IntImm to int.
  • Loading branch information
Tristan Konolige authored and ylc committed Jan 13, 2022
1 parent 04a0330 commit 7907f45
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions python/tvm/tir/expr.py
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,9 @@ def __init__(self, dtype, value, span=None):
tvm.ir._ffi_api.FloatImm, dtype, value, span # type: ignore
)

def __float__(self):
return self.value


@tvm._ffi.register_object
class IntImm(ConstExpr):
Expand Down

0 comments on commit 7907f45

Please sign in to comment.