Hi all,
I was confused by the definition of `HLO_ReshapeOp` and `TF_ReshapeOp`.
1) `TF_ReshapeOp `:
```
def TF_ReshapeOp : TF_Op<"Reshape", [NoSideEffect]> {
let summary = "Reshapes a tensor.";
let description = [{
// ....
}];
let arguments = (ins
TF_Tensor:$tensor,
TF_I32OrI64Tensor:$shape
);
let results = (outs
TF_Tensor:$output
);
TF_DerivedOperandTypeAttr T = TF_DerivedOperandTypeAttr<0>;
TF_DerivedOperandTypeAttr Tshape = TF_DerivedOperandTypeAttr<1>;
let builders = [
OpBuilder<
"Builder* builder, OperationState& result, Value tensor, Value shape">
];
let verifier = [{
return Verify(*this);
}];
}
```
2) `HLO_ReshapeOp`:
```
def HLO_ReshapeOp: HLO_Op<"reshape",
[NoSideEffect, SameOperandsAndResultElementType]>, BASE_HLO_ReshapeOp {
let arguments = (ins HLO_Tensor:$operand);
let results = (outs HLO_Tensor);
let hasFolder = 1;
let hasCustomHLOConverter = 1;
}
```
`TF_ReshapeOp` has two inputs that make us know how to reshape input-0 by input-1.
But `HLO_ReshapeOp` has only one input, so how to express the reshape semantics.
There has no code which lowering `TF_ReshapeOp` to `HLO_ReshapeOp`,
so here I was some confused by the op definition.
Thanks.
Ace.