Skip to content

Commit

Permalink
cast to int
Browse files Browse the repository at this point in the history
  • Loading branch information
ZwX1616 committed Aug 28, 2024
1 parent ae5d140 commit f51aa0f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion extra/onnx.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def fetch_tensor(x: str):
arg[axis] = (starts[i], ends[i], steps[i])
new_shape = tuple((s, e) if st > 0 else (e+1, s+1) for s, e, st in arg)
if any(s==e for s,e in new_shape): ret = inp[0].shrink(new_shape)
else: ret = inp[0].__getitem__(tuple([slice(s,e,st) for s,e,st in arg]))
else: ret = inp[0].__getitem__(tuple([slice(s,e,int(st)) for s,e,st in arg]))
elif n.op_type == "Gradient": # need to call backward on intermediate_tensors
assert len(opt["xs"]) == len(inp), f"len(opt['xs']):{len(opt['xs'])}, len(inp):{len(inp)} output and input has to match"
y = opt["y"]
Expand Down

0 comments on commit f51aa0f

Please sign in to comment.