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(
188
188
ctx->input_is_dynamic = true ;
189
189
}
190
190
191
- ctx->AddNamedTensor (in, trt_in);
191
+ ctx->RecordNewTensor (in, trt_in);
192
192
ctx->num_inputs += 1 ;
193
193
}
194
194
Original file line number Diff line number Diff line change @@ -130,7 +130,7 @@ ConversionCtx::~ConversionCtx() {
130
130
}
131
131
132
132
nvinfer1::ITensor* ConversionCtx::AssociateValueAndTensor (const torch::jit::Value* value, nvinfer1::ITensor* tensor) {
133
- if (!AddNamedTensor (value, tensor)) {
133
+ if (!RecordNewTensor (value, tensor)) {
134
134
LOG_WARNING (
135
135
" Trying to rewrite the name " << value->debugName () << " to a named ITensor " << tensor->getName () << " ." );
136
136
}
@@ -143,9 +143,9 @@ torch::jit::IValue* ConversionCtx::AssociateValueAndIValue(const torch::jit::Val
143
143
return &this ->evaluated_value_map [value];
144
144
}
145
145
146
- bool ConversionCtx::AddNamedTensor (const torch::jit::Value* value, nvinfer1::ITensor* tensor) {
146
+ bool ConversionCtx::RecordNewTensor (const torch::jit::Value* value, nvinfer1::ITensor* tensor) {
147
147
value_tensor_map[value] = tensor;
148
- auto ret = named_tensors .insert (tensor);
148
+ auto ret = known_tensors .insert (tensor);
149
149
return ret.second ;
150
150
}
151
151
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ struct ConversionCtx {
46
46
ConversionCtx (BuilderSettings settings);
47
47
std::string SerializeEngine ();
48
48
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);
50
50
torch::jit::IValue* AssociateValueAndIValue (const torch::jit::Value* value, torch::jit::IValue tensor);
51
51
bool CheckLayerAddition (const torch::jit::Node* n);
52
52
@@ -72,7 +72,7 @@ struct ConversionCtx {
72
72
std::unordered_map<const torch::jit::Value*, torch::jit::IValue> evaluated_value_map;
73
73
74
74
// 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 ;
76
76
};
77
77
78
78
} // namespace conversion
You can’t perform that action at this time.
0 commit comments