Skip to content

Commit 9f0e17d

Browse files
committed
Mark both the input and output of custom ops as variadic, to allow copying the element type not only for the first result
1 parent 99c057f commit 9f0e17d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Builder/FrontendDialectTransformer.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -874,8 +874,9 @@ class FrontendGenImpl {
874874
}
875875
unsigned int j = i;
876876
// Variadic output is a single ODS result.
877-
if (variadicOut)
877+
if (variadicOut) {
878878
j = 0;
879+
}
879880
if (!givenOutputTypes.empty()) {
880881
outputTypes.emplace_back(
881882
UnrankedTensorType::get(givenOutputTypes[i]));
@@ -1570,10 +1571,9 @@ class FrontendGenImpl {
15701571
auto domainAttr = builder_.getNamedAttr(
15711572
"domain_name", builder_.getStringAttr(node.domain()));
15721573
attributes.push_back(domainAttr);
1573-
int nIn = 0;
1574-
int nOut = 0;
1574+
const int nIn = ONNXCustomOp::getNumberOfOperands();
1575+
const int nOut = ONNXCustomOp::getNumberOfResults();
15751576
getNodeInputs(node, inputs);
1576-
nOut = node.output().size();
15771577
std::vector<Type> givenOutputTypes;
15781578

15791579
// We lack a way of specifying import behavior for custom domains. For now

0 commit comments

Comments
 (0)