We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 89d4a98 commit 07c9c2dCopy full SHA for 07c9c2d
py/torch_tensorrt/_Input.py
@@ -364,18 +364,11 @@ def example_tensor(
364
)
365
366
if isinstance(self.shape, dict):
367
- if (
368
- self.dtype == dtype.u8
369
- or self.dtype == dtype.i8
370
- or self.dtype == dtype.i32
371
- or self.dtype == dtype.i64
372
- ):
+ if self.dtype in [dtype.u8, dtype.i8, dtype.i32, dtype.i64]:
373
type = self.dtype.to(torch.dtype, use_default=True)
374
- min_value = torch.iinfo(type).min
375
- max_value = torch.iinfo(type).max
376
return torch.randint(
377
- min_value,
378
- max_value,
+ torch.iinfo(type).min,
+ torch.iinfo(type).max,
379
self.shape[optimization_profile_field],
380
dtype=type,
381
0 commit comments