[MLIR][HLO] Add `Elementwise` trait to unary element-wise ops
PiperOrigin-RevId: 363428909
This commit is contained in:
parent
cd52adb20e
commit
f1408e791e
|
@ -119,10 +119,9 @@ def HLO_CreateTokenOp : HLO_Op<"create_token", [NoSideEffect]> {
|
||||||
// See https://www.tensorflow.org/xla/operation_semantics#element-wise_unary_functions
|
// See https://www.tensorflow.org/xla/operation_semantics#element-wise_unary_functions
|
||||||
|
|
||||||
class HLO_UnaryElementwiseOp<string mnemonic, list<OpTrait> traits,
|
class HLO_UnaryElementwiseOp<string mnemonic, list<OpTrait> traits,
|
||||||
Type TensorType>: HLO_Op<mnemonic,
|
Type TensorType> : HLO_Op<mnemonic, traits # [Elementwise,
|
||||||
!listconcat(traits,
|
InferShapedTypeOpInterface, InferFusibilityOpInterface,
|
||||||
[InferShapedTypeOpInterface, InferFusibilityOpInterface,
|
SameOperandsAndResultShape]> {
|
||||||
SameOperandsAndResultShape])> {
|
|
||||||
let arguments = (ins TensorType:$operand);
|
let arguments = (ins TensorType:$operand);
|
||||||
let results = (outs TensorType);
|
let results = (outs TensorType);
|
||||||
let extraClassDeclaration = [{
|
let extraClassDeclaration = [{
|
||||||
|
|
Loading…
Reference in New Issue