File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed
core/conversion/conversionctx Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -130,11 +130,8 @@ ConversionCtx::~ConversionCtx() {
130
130
}
131
131
132
132
nvinfer1::ITensor* ConversionCtx::AssociateValueAndTensor (const torch::jit::Value* value, nvinfer1::ITensor* tensor) {
133
- if (!RecordNewTensor (value, tensor)) {
134
- LOG_WARNING (
135
- " Trying to rewrite the name " << value->debugName () << " to a named ITensor " << tensor->getName () << " ." );
136
- }
137
- tensor->setName (value->debugName ().c_str ());
133
+ RecordNewTensor (value, tensor);
134
+
138
135
return tensor;
139
136
}
140
137
@@ -143,10 +140,13 @@ torch::jit::IValue* ConversionCtx::AssociateValueAndIValue(const torch::jit::Val
143
140
return &this ->evaluated_value_map [value];
144
141
}
145
142
146
- bool ConversionCtx::RecordNewTensor (const torch::jit::Value* value, nvinfer1::ITensor* tensor) {
143
+ void ConversionCtx::RecordNewTensor (const torch::jit::Value* value, nvinfer1::ITensor* tensor) {
147
144
value_tensor_map[value] = tensor;
148
145
auto ret = known_tensors.insert (tensor);
149
- return ret.second ;
146
+ if (!ret) {
147
+ LOG_WARNING (
148
+ " Trying to record the value " << value->debugName () << " with the ITensor " << tensor->getName () << " again." );
149
+ }
150
150
}
151
151
152
152
std::string ConversionCtx::SerializeEngine () {
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 RecordNewTensor (const torch::jit::Value* value, nvinfer1::ITensor* tensor);
49
+ void 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
You can’t perform that action at this time.
0 commit comments