Skip to content

Commit

Permalink
chore: Linter fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Dheeraj Peri <peri.dheeraj@gmail.com>
  • Loading branch information
peri044 committed Apr 19, 2023
1 parent 13caff0 commit 2addf5e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 1 addition & 3 deletions py/torch_tensorrt/_Input.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,9 +384,7 @@ def example_tensor(self, optimization_profile_field: str = None) -> torch.Tensor
)

if self.shape_mode == Input._ShapeMode.STATIC:
return torch.rand(self.shape).to(
dtype=self.torch_dtype
)
return torch.rand(self.shape).to(dtype=self.torch_dtype)
else:
return torch.rand(self.shape[optimization_profile_field]).to(
dtype=self.torch_dtype
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ def test_from_static_input(self):
self._validate_spec(spec, tensor)

def test_from_dynamic_input(self):
inputs = torch_tensorrt.Input(min_shape=(2, 2, 3), opt_shape=(4, 2, 3), max_shape=(8, 2, 3))
inputs = torch_tensorrt.Input(
min_shape=(2, 2, 3), opt_shape=(4, 2, 3), max_shape=(8, 2, 3)
)
example_tensor = inputs.example_tensor(optimization_profile_field="opt_shape")
spec = InputTensorSpec.from_input(inputs)
self._validate_spec(spec, example_tensor, dynamic_dims=[0])
Expand Down

0 comments on commit 2addf5e

Please sign in to comment.