Skip to content

Commit

Permalink
Add Handling of Zero Len Arguments (apache#6923)
Browse files Browse the repository at this point in the history
* Update tensorrt.py

* Update tensorrt.py

* Update tensorrt.py
  • Loading branch information
codeislife99 authored and trevor-m committed Dec 4, 2020
1 parent bebeb52 commit d0d541a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions python/tvm/relay/op/contrib/tensorrt.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,10 @@ def add_annotate_fn(expr): # pylint: disable=unused-variable
"""Check if add is supported by TensorRT."""

args = expr.args
# RelayVM + TRT doesn't support scalar addition yet.
for arg in args:
if not arg.checked_type.shape:
return False
if any([x.checked_type.dtype != "float32" for x in args]):
logger.info("Only float32 inputs are supported for TensorRT.")
return False
Expand Down

0 comments on commit d0d541a

Please sign in to comment.