The cuda is None check is useless because cuda is always defined by line 73 after the 0b3a10546183dbec946aa1d5e434e13729b727c9 refactor (this is caught by mypy). So what actually ends up happening is that the TRT backend is always chosen if it's supported by the current system, even if the user explicitly wants another backend.
The
cuda is None
check is useless becausecuda
is always defined by line 73 after the 0b3a10546183dbec946aa1d5e434e13729b727c9 refactor (this is caught by mypy). So what actually ends up happening is that the TRT backend is always chosen if it's supported by the current system, even if the user explicitly wants another backend.Before:
After: