Skip to content

Commit 2d65ece

Browse files
committed
fix(//core/conversion/conversionctx): Check both tensor and eval maps
before throwing conversion warning Signed-off-by: Naren Dasan <[email protected]> Signed-off-by: Naren Dasan <[email protected]>
1 parent 78a1c61 commit 2d65ece

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

core/conversion/conversionctx/ConversionCtx.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,13 @@ std::string ConversionCtx::SerializeEngine() {
118118

119119
bool ConversionCtx::CheckLayerAddition(const torch::jit::Node* n) {
120120
for (auto out : n->outputs()) {
121-
auto iter = this->value_tensor_map.find(out);
122-
if (iter == this->value_tensor_map.end()) {
123-
LOG_WARNING("Node " << util::node_info(n) << " output: " << out->debugName() << " does not have a coresponding output, may potentially indicate a defective converter");
124-
return false;
121+
auto iter_t = this->value_tensor_map.find(out);
122+
if (iter_t == this->value_tensor_map.end()) {
123+
auto iter_iv = this->evaluated_value_map.find(out);
124+
if (iter_iv == this->evaluated_value_map.end()) {
125+
LOG_WARNING("Node " << util::node_info(n) << " output: " << out->debugName() << " does not have a coresponding value or tensor, may potentially indicate a defective evaluator or converter");
126+
return false;
127+
}
125128
}
126129
}
127130
return true;

0 commit comments

Comments
 (0)