NVIDIA-AI-IOT / torch2trt

An easy to use PyTorch to TensorRT converter
MIT License
4.49k stars 670 forks source link

SyntaxWarning of dataset.py:61 #930

Open grapevine-AI opened 1 month ago

grapevine-AI commented 1 month ago

Hello.

SyntaxWarning appeared when I imported torch2trt.

C:\DeepLearning\torch2trt-master\torch2trt\dataset.py:61: SyntaxWarning: assertion is always true, perhaps remove parentheses?
  assert(len(self) > 0, 'Cannot create default flattener without input data.')

I think that you aim not assert(len(self) > 0, 'Cannot create default flattener without input data.') but assert len(self) > 0, 'Cannot create default flattener without input data.'.

Please review.

jaybdub commented 1 month ago

Good catch!

Will try to test the fix soon.