Skip to content

Commit 7bbb07a

Browse files
committed
chore: clean up for random int type input
1 parent be6acbe commit 7bbb07a

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

py/torch_tensorrt/_Input.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -372,18 +372,11 @@ def example_tensor(
372372
)
373373

374374
if isinstance(self.shape, dict):
375-
if (
376-
self.dtype == dtype.u8
377-
or self.dtype == dtype.i8
378-
or self.dtype == dtype.i32
379-
or self.dtype == dtype.i64
380-
):
375+
if self.dtype in [dtype.u8, dtype.i8, dtype.i32, dtype.i64]:
381376
type = self.dtype.to(torch.dtype, use_default=True)
382-
min_value = torch.iinfo(type).min
383-
max_value = torch.iinfo(type).max
384377
return torch.randint(
385-
min_value,
386-
max_value,
378+
torch.iinfo(type).min,
379+
torch.iinfo(type).max,
387380
self.shape[optimization_profile_field],
388381
dtype=type,
389382
)

0 commit comments

Comments
 (0)