Skip to content

Added Converters for Basic Casting Operations #607

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

JWLee89
Copy link

@JWLee89 JWLee89 commented Aug 11, 2021

Added support for the following casting operations under the converters/cast.py.

  • .float(). e.g x.float()
  • .int(). e.g x.int()
  • .bool(). e.g x.bool()

Tests are included along with the converters (see attached image below).

Note: .long() is not included as this is a 64 bit data type and TensorRT does not support 64 bit data types.

Test Outputs

NUM_TESTS: 330
NUM_SUCCESSFUL_CONVERSION: 329
NUM_FAILED_CONVERSION: 1
NUM_ABOVE_TOLERANCE: 4
NUM_pSNR_TOLERANCE: 11

Verified that the one NUM_FAILED_CONVERSION is unrelated to the added code by commenting out from .cast import * in __init__.py and re-running tests.

Test environment

PyTorch version: 1.8.0+cu111
Cuda: 11.1
TensorRT Version: 7.2.2.1
GPU: GeForce RTX 3090
Ubuntu version: Ubuntu 18.04.5 LTS

cast_test

@JWLee89 JWLee89 changed the title Added TensorRT Converters for Basic Casting Operations Added Converters for Basic Casting Operations Aug 12, 2021
@JWLee89
Copy link
Author

JWLee89 commented May 18, 2022

Hi @jaybdub,

I was wondering if there are any possible potential issues with this PR?
If so, do you have any suggestions on how to improve the feature?

P.S. Apologies for the ping. I know that you are busy.

Thank you very much for taking time out of your schedule to take a look at this.

Best regards,
Jay

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants