use uniqued constant helpers everywhere materialize transposed constants directly
This commit is contained in:
@@ -83,7 +83,7 @@ static FailureOr<Value> materializeBroadcastedConstantTensor(Value value,
|
||||
}
|
||||
|
||||
auto broadcastedAttr = DenseElementsAttr::get(resultType, resultValues);
|
||||
return arith::ConstantOp::create(rewriter, loc, resultType, broadcastedAttr).getResult();
|
||||
return getOrCreateConstant(rewriter, rewriter.getInsertionBlock()->getParentOp(), broadcastedAttr, resultType);
|
||||
}
|
||||
|
||||
static FailureOr<Value>
|
||||
@@ -121,7 +121,7 @@ static FailureOr<Value> materializeReciprocalTensor(Value value,
|
||||
}
|
||||
|
||||
auto reciprocalAttr = DenseFPElementsAttr::get(resultType, reciprocalValues);
|
||||
return arith::ConstantOp::create(rewriter, loc, resultType, reciprocalAttr).getResult();
|
||||
return getOrCreateConstant(rewriter, rewriter.getInsertionBlock()->getParentOp(), reciprocalAttr, resultType);
|
||||
}
|
||||
|
||||
template <typename OnnxOp, typename SpatialOp>
|
||||
|
||||
Reference in New Issue
Block a user