Skip to content

Commit

Permalink
chore: clean up for random int type input
Browse files Browse the repository at this point in the history
  • Loading branch information
keehyuna committed Jun 5, 2024
1 parent 89d4a98 commit 07c9c2d
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions py/torch_tensorrt/_Input.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,18 +364,11 @@ def example_tensor(
)

if isinstance(self.shape, dict):
if (
self.dtype == dtype.u8
or self.dtype == dtype.i8
or self.dtype == dtype.i32
or self.dtype == dtype.i64
):
if self.dtype in [dtype.u8, dtype.i8, dtype.i32, dtype.i64]:
type = self.dtype.to(torch.dtype, use_default=True)
min_value = torch.iinfo(type).min
max_value = torch.iinfo(type).max
return torch.randint(
min_value,
max_value,
torch.iinfo(type).min,
torch.iinfo(type).max,
self.shape[optimization_profile_field],
dtype=type,
)
Expand Down

0 comments on commit 07c9c2d

Please sign in to comment.