Removed all (most) BASE_HLO_* ops.

Moved the corresponding `summary` and `description` fields into the subclasses.
Kept BASE_HLO_ConvOp for `hasWindowReversal()'.

PiperOrigin-RevId: 373173025
This commit is contained in:
Itai Zukerman 2021-05-11 09:47:40 -07:00 committed by TensorFlow MLIR Team
parent 7f7a86ad0d
commit a4db6c57aa
4 changed files with 1559 additions and 1427 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -44,8 +44,13 @@ def I32Buffer : MemRefOf<[I32]>;
// calls generate or consume standard deviation, whereas LHLO ops generate or
// consume variance (= std-dev ^ 2).
def LHLOGPU_BatchNormGradOp : LHLOGPU_Op<"batch_norm_grad">,
BASE_HLO_BatchNormGradOp {
def LHLOGPU_BatchNormGradOp : LHLOGPU_Op<"batch_norm_grad"> {
let summary = "Batch Normalization Gradient";
let description = [{
Calculates gradients of batch norm.
See https://www.tensorflow.org/xla/operation_semantics#batchnormgrad
}];
let arguments = (ins
Arg<LHLO_FpBuffer, "", [MemRead]>:$operand,
Arg<LHLO_FpBuffer, "", [MemRead]>:$scale,
@ -60,8 +65,13 @@ def LHLOGPU_BatchNormGradOp : LHLOGPU_Op<"batch_norm_grad">,
);
}
def LHLOGPU_BatchNormInferenceOp : LHLOGPU_Op<"batch_norm_inference">,
BASE_HLO_BatchNormInferenceOp {
def LHLOGPU_BatchNormInferenceOp : LHLOGPU_Op<"batch_norm_inference"> {
let summary = "Batch Normalization for Inference";
let description = [{
Normalizes an array across batch and spatial dimensions.
See https://www.tensorflow.org/xla/operation_semantics#batchnorminference
}];
let arguments = (ins
Arg<LHLO_FpBuffer, "", [MemRead]>:$operand,
Arg<LHLO_FpBuffer, "", [MemRead]>:$scale,
@ -73,8 +83,13 @@ def LHLOGPU_BatchNormInferenceOp : LHLOGPU_Op<"batch_norm_inference">,
I64Attr:$feature_index);
}
def LHLOGPU_BatchNormTrainingOp : LHLOGPU_Op<"batch_norm_training">,
BASE_HLO_BatchNormTrainingOp {
def LHLOGPU_BatchNormTrainingOp : LHLOGPU_Op<"batch_norm_training"> {
let summary = "Batch Normalization for Training";
let description = [{
Normalizes an array across batch and spatial dimensions.
See https://www.tensorflow.org/xla/operation_semantics#batchnormtraining
}];
let arguments = (ins
Arg<LHLO_FpBuffer, "", [MemRead]>:$operand,

File diff suppressed because it is too large Load Diff