Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions python/tvm/relay/frontend/pytorch.py
Original file line number Diff line number Diff line change
Expand Up @@ -2059,9 +2059,21 @@ def scatter_add(self, inputs, input_types):
src = inputs[3]
return _op.scatter_add(data, index, src, axis=axis)

def is_floating_point(self, inputs, input_types):
assert len(inputs) == 1

if isinstance(inputs[0], _expr.Expr):
input_type = self.infer_type(inputs[0]).dtype
else:
input_type = input_types[0]

is_float = input_type in ["float32", "float64", "float16"]
return _expr.const(is_float)

# Operator mappings
def create_convert_map(self):
self.convert_map = {
"aten::is_floating_point": self.is_floating_point,
"aten::pixel_shuffle": self.pixel_shuffle,
"aten::device": self.none,
"prim::device": self.none,
Expand All @@ -2077,6 +2089,7 @@ def create_convert_map(self):
"aten::div": self.make_elemwise("divide"),
"aten::div_": self.make_elemwise("divide"),
"aten::floor_divide": self.make_elemwise("floor_divide"),
"aten::floor_divide_": self.make_elemwise("floor_divide"),
"aten::true_divide": self.make_elemwise("divide"),
"aten::addcdiv": self.addcdiv,
"aten::addcmul": self.addcmul,
Expand Down