Remove BASE_HLO_ConvOp to remove coupling between MHLO and LMHLO conv ops
PiperOrigin-RevId: 373201247
This commit is contained in:
parent
a4db6c57aa
commit
2ea9470515
|
@ -1383,7 +1383,13 @@ def HLO_CollectivePermuteOp: HLO_Op<"collective_permute",
|
||||||
let results = (outs HLO_Tensor);
|
let results = (outs HLO_Tensor);
|
||||||
}
|
}
|
||||||
|
|
||||||
def HLO_ConvOp : HLO_Op<"convolution", [NoSideEffect]>, BASE_HLO_ConvOp {
|
def HLO_ConvOp : HLO_Op<"convolution", [NoSideEffect]> {
|
||||||
|
let summary = "Convolution operator";
|
||||||
|
let description = [{
|
||||||
|
Computes a convolution of the kind used in neural networks.
|
||||||
|
|
||||||
|
See https://www.tensorflow.org/xla/operation_semantics#conv_convolution.
|
||||||
|
}];
|
||||||
let arguments = !con(
|
let arguments = !con(
|
||||||
(ins
|
(ins
|
||||||
HLO_Tensor:$lhs,
|
HLO_Tensor:$lhs,
|
||||||
|
@ -1392,6 +1398,14 @@ def HLO_ConvOp : HLO_Op<"convolution", [NoSideEffect]>, BASE_HLO_ConvOp {
|
||||||
|
|
||||||
let results = (outs HLO_Tensor);
|
let results = (outs HLO_Tensor);
|
||||||
let hasCustomHLOConverter = 1;
|
let hasCustomHLOConverter = 1;
|
||||||
|
|
||||||
|
code extraClassDeclaration = [{
|
||||||
|
bool hasWindowReversal() {
|
||||||
|
auto reversal = window_reversalAttr();
|
||||||
|
return reversal && llvm::any_of(reversal.getBoolValues(),
|
||||||
|
[](bool v) { return v; });
|
||||||
|
}
|
||||||
|
}];
|
||||||
}
|
}
|
||||||
|
|
||||||
def HLO_CopyOp: HLO_Op<"copy", [NoSideEffect, SameOperandsAndResultType]> {
|
def HLO_CopyOp: HLO_Op<"copy", [NoSideEffect, SameOperandsAndResultType]> {
|
||||||
|
|
|
@ -150,21 +150,6 @@ def ConvolutionAttributes {
|
||||||
}
|
}
|
||||||
|
|
||||||
class BASE_HLO_ConvOp {
|
class BASE_HLO_ConvOp {
|
||||||
string summary = "Convolution operator";
|
|
||||||
|
|
||||||
string description = [{
|
|
||||||
Computes a convolution of the kind used in neural networks.
|
|
||||||
|
|
||||||
See https://www.tensorflow.org/xla/operation_semantics#conv_convolution.
|
|
||||||
}];
|
|
||||||
|
|
||||||
code extraClassDeclaration = [{
|
|
||||||
bool hasWindowReversal() {
|
|
||||||
auto reversal = window_reversalAttr();
|
|
||||||
return reversal && llvm::any_of(reversal.getBoolValues(),
|
|
||||||
[](bool v) { return v; });
|
|
||||||
}
|
|
||||||
}];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // HLO_OPS_BASE
|
#endif // HLO_OPS_BASE
|
||||||
|
|
|
@ -844,13 +844,27 @@ def LHLO_ConcatenateOp : LHLO_Op<"concatenate", []> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
def LHLO_ConvOp : LHLO_Op<"convolution", []>, BASE_HLO_ConvOp {
|
def LHLO_ConvOp : LHLO_Op<"convolution", []> {
|
||||||
|
let summary = "Convolution operator";
|
||||||
|
let description = [{
|
||||||
|
Computes a convolution of the kind used in neural networks.
|
||||||
|
|
||||||
|
See https://www.tensorflow.org/xla/operation_semantics#conv_convolution.
|
||||||
|
}];
|
||||||
let arguments = !con(
|
let arguments = !con(
|
||||||
(ins
|
(ins
|
||||||
Arg<LHLO_Buffer, "", [MemRead]>:$lhs,
|
Arg<LHLO_Buffer, "", [MemRead]>:$lhs,
|
||||||
Arg<LHLO_Buffer, "", [MemRead]>:$rhs,
|
Arg<LHLO_Buffer, "", [MemRead]>:$rhs,
|
||||||
Arg<LHLO_Buffer, "", [MemWrite]>:$output),
|
Arg<LHLO_Buffer, "", [MemWrite]>:$output),
|
||||||
ConvolutionAttributes.attributes);
|
ConvolutionAttributes.attributes);
|
||||||
|
|
||||||
|
code extraClassDeclaration = [{
|
||||||
|
bool hasWindowReversal() {
|
||||||
|
auto reversal = window_reversalAttr();
|
||||||
|
return reversal && llvm::any_of(reversal.getBoolValues(),
|
||||||
|
[](bool v) { return v; });
|
||||||
|
}
|
||||||
|
}];
|
||||||
}
|
}
|
||||||
|
|
||||||
def LHLO_CopyOp: LHLO_Op<"copy", [CopyOpInterface]> {
|
def LHLO_CopyOp: LHLO_Op<"copy", [CopyOpInterface]> {
|
||||||
|
|
Loading…
Reference in New Issue