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
4 changes: 2 additions & 2 deletions python/tvm/relay/frontend/tensorflow_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -2454,16 +2454,16 @@ def _impl(inputs, attr, params, mod):
delta = inputs[2]

# if all attributes are constant, evalute the range function and return relay.const
dtype = attr["Tidx"].name if "Tidx" in attr else str(start.dtype)
if all(
[
isinstance(start, (np.int32, np.int64, int, np.float32, np.float64, float)),
isinstance(limit, (np.int32, np.int64, int, np.float32, np.float64, float)),
isinstance(delta, (np.int32, np.int64, int, np.float32, np.float64, float)),
]
):
return tvm.relay.const(list(range(int(start), int(limit), int(delta))))
return tvm.relay.const(list(range(int(start), int(limit), int(delta))), dtype=dtype)

dtype = attr["Tidx"].name if "Tidx" in attr else str(start.dtype)
if isinstance(start, (np.int32, np.int64, int, np.float32, np.float64, float)):
start = _expr.const(start, dtype=dtype)
if isinstance(limit, (np.int32, np.int64, int, np.float32, np.float64, float)):
Expand Down