File tree 2 files changed +7
-3
lines changed
python/tvm/relay/op/contrib
src/runtime/contrib/tensorrt
2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -733,8 +733,12 @@ def pad_annotate_fn(expr): # pylint: disable=unused-variable
733
733
if attrs .pad_mode != "constant" :
734
734
logger .info ("nn.pad: pad mode is %s but must be constant." , attrs .pad_mode )
735
735
return False
736
- if float (attrs .pad_value ) != 0.0 :
737
- logger .info ("nn.pad: pad value is %f but must be 0.0." , float (attrs .pad_value ))
736
+ if (
737
+ not isinstance (args [1 ], relay .Constant )
738
+ or len (args [1 ].checked_type .shape ) != 0
739
+ or args [1 ].data .numpy ().item () != 0.0
740
+ ):
741
+ logger .info ("nn.pad: pad value is %s but must be 0.0." , args [1 ])
738
742
return False
739
743
if len (attrs .pad_width ) not in [4 , 5 ]:
740
744
logger .info ("nn.pad: can only pad 4D or 5D inputs" )
Original file line number Diff line number Diff line change @@ -1057,7 +1057,7 @@ class ReshapeOpConverter : public TensorRTOpConverter {
1057
1057
1058
1058
class PadOpConverter : public TensorRTOpConverter {
1059
1059
public:
1060
- PadOpConverter () : TensorRTOpConverter({kTensor }) {}
1060
+ PadOpConverter () : TensorRTOpConverter({kTensor , kWeight }) {}
1061
1061
1062
1062
void Convert (TensorRTOpConverterParams* params) const {
1063
1063
auto input = params->inputs .at (0 ).tensor ;
You can’t perform that action at this time.
0 commit comments