@@ -161,15 +161,15 @@ nvinfer1::ILayer* add_absolute_value(
161
161
const torch::jit::Node* n,
162
162
nvinfer1::ITensor* self,
163
163
const std::string& name) {
164
- nvinfer1::ILayer* absolute_value ;
164
+ nvinfer1::ILayer* absolute_value_layer ;
165
165
166
166
// Check if TRT Unary ops support the input type
167
167
bool unary_supported_input = (self->getType () == nvinfer1::DataType::kFLOAT ) ||
168
168
(self->getType () == nvinfer1::DataType::kHALF ) || (self->getType () == nvinfer1::DataType::kINT8 );
169
169
if (unary_supported_input) {
170
- absolute_value = ctx->net ->addUnary (*self, nvinfer1::UnaryOperation::kABS );
171
- TORCHTRT_CHECK (absolute_value , " Unable to create abs layer from node: " << *n);
172
- absolute_value ->setName (name.c_str ());
170
+ absolute_value_layer = ctx->net ->addUnary (*self, nvinfer1::UnaryOperation::kABS );
171
+ TORCHTRT_CHECK (absolute_value_layer , " Unable to create abs layer from node: " << *n);
172
+ absolute_value_layer ->setName (name.c_str ());
173
173
} else {
174
174
LOG_GRAPH (
175
175
" Tensor is of unsupported type "
@@ -180,11 +180,12 @@ nvinfer1::ILayer* add_absolute_value(
180
180
auto neg_layer = add_elementwise (
181
181
ctx, nvinfer1::ElementWiseOperation::kPROD , self, neg_one_const, util::node_info (n) + std::string (" _Negation" ));
182
182
TORCHTRT_CHECK (neg_layer, " Unable to create prod layer from node: " << *n);
183
- absolute_value = add_elementwise (ctx, nvinfer1::ElementWiseOperation::kMAX , self, neg_layer->getOutput (0 ), name);
184
- TORCHTRT_CHECK (absolute_value, " Unable to create max layer from node: " << *n);
183
+ absolute_value_layer =
184
+ add_elementwise (ctx, nvinfer1::ElementWiseOperation::kMAX , self, neg_layer->getOutput (0 ), name);
185
+ TORCHTRT_CHECK (absolute_value_layer, " Unable to create max layer from node: " << *n);
185
186
}
186
187
187
- return absolute_value ;
188
+ return absolute_value_layer ;
188
189
}
189
190
190
191
nvinfer1::ITensor* applyIdentityOp (ConversionCtx* ctx, nvinfer1::ITensor* tensor, const std::string& tensor_name) {
0 commit comments