Skip to content

Commit

Permalink
fix bugs of zeros ,ones
Browse files Browse the repository at this point in the history
  • Loading branch information
grimoire committed Sep 26, 2020
1 parent 3702fbd commit 1f247bf
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions torch2trt/converters/new_ones.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ def convert_new_ones(ctx):

output = ctx.method_return

if isinstance(size, int):
size = (size, )

# check const
is_const = True
for s in size:
Expand Down
3 changes: 3 additions & 0 deletions torch2trt/converters/new_zeros.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ def convert_new_zeros(ctx):

output = ctx.method_return

if isinstance(size, int):
size = (size, )

# check const
is_const = True
for s in size:
Expand Down
3 changes: 3 additions & 0 deletions torch2trt/converters/zeros.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ def convert_zeros(ctx):
dtype = ctx.method_kwargs["dtype"]
output = ctx.method_return

if isinstance(size, int):
size = (size, )

# check const
is_const = True
for s in size:
Expand Down

0 comments on commit 1f247bf

Please sign in to comment.