File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -188,7 +188,7 @@ void AddInputs(
188188 ctx->input_is_dynamic = true ;
189189 }
190190
191- ctx->AddNamedTensor (in, trt_in);
191+ ctx->RecordNewTensor (in, trt_in);
192192 ctx->num_inputs += 1 ;
193193 }
194194
Original file line number Diff line number Diff line change @@ -130,7 +130,7 @@ ConversionCtx::~ConversionCtx() {
130130}
131131
132132nvinfer1::ITensor* ConversionCtx::AssociateValueAndTensor (const torch::jit::Value* value, nvinfer1::ITensor* tensor) {
133- if (!AddNamedTensor (value, tensor)) {
133+ if (!RecordNewTensor (value, tensor)) {
134134 LOG_WARNING (
135135 " Trying to rewrite the name " << value->debugName () << " to a named ITensor " << tensor->getName () << " ." );
136136 }
@@ -143,9 +143,9 @@ torch::jit::IValue* ConversionCtx::AssociateValueAndIValue(const torch::jit::Val
143143 return &this ->evaluated_value_map [value];
144144}
145145
146- bool ConversionCtx::AddNamedTensor (const torch::jit::Value* value, nvinfer1::ITensor* tensor) {
146+ bool ConversionCtx::RecordNewTensor (const torch::jit::Value* value, nvinfer1::ITensor* tensor) {
147147 value_tensor_map[value] = tensor;
148- auto ret = named_tensors .insert (tensor);
148+ auto ret = known_tensors .insert (tensor);
149149 return ret.second ;
150150}
151151
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ struct ConversionCtx {
4646 ConversionCtx (BuilderSettings settings);
4747 std::string SerializeEngine ();
4848 nvinfer1::ITensor* AssociateValueAndTensor (const torch::jit::Value* value, nvinfer1::ITensor* tensor);
49- bool AddNamedTensor (const torch::jit::Value* value, nvinfer1::ITensor* tensor);
49+ bool RecordNewTensor (const torch::jit::Value* value, nvinfer1::ITensor* tensor);
5050 torch::jit::IValue* AssociateValueAndIValue (const torch::jit::Value* value, torch::jit::IValue tensor);
5151 bool CheckLayerAddition (const torch::jit::Node* n);
5252
@@ -72,7 +72,7 @@ struct ConversionCtx {
7272 std::unordered_map<const torch::jit::Value*, torch::jit::IValue> evaluated_value_map;
7373
7474 // record already named ITensors to prevent rewriting another name to the same tensor
75- std::unordered_set<nvinfer1::ITensor*> named_tensors ;
75+ std::unordered_set<nvinfer1::ITensor*> known_tensors ;
7676};
7777
7878} // namespace conversion
You can’t perform that action at this time.
0 commit comments