Add auto generated TensorFlow ops XlaBroadcastHelperOp, XlaConv, XlaDot, XlaDynamicSliceOp, XlaGatherOp, XlaKeyValueSortOp, XlaPadOp, XlaReduceOp, XlaReplicaIdOp and XlaSelfAdjointEigOp

PiperOrigin-RevId: 307031848
Change-Id: I4fa3ce37f12639dcfbaec125e23ede6b9dd9448d
This commit is contained in:
Smit Hinsu 2020-04-17 06:23:29 -07:00 committed by TensorFlower Gardener
parent e3ed854c1d
commit 2d676104cb

View File

@ -9493,6 +9493,110 @@ def TF_XdivyOp : TF_Op<"Xdivy", [NoSideEffect, ResultsBroadcastableShape]>,
let hasCanonicalizer = 1;
}
def TF_XlaBroadcastHelperOp : TF_Op<"XlaBroadcastHelper", [NoSideEffect]> {
let summary = "Helper operator for performing XLA-style broadcasts";
let description = [{
Broadcasts `lhs` and `rhs` to the same rank, by adding size 1 dimensions to
whichever of `lhs` and `rhs` has the lower rank, using XLA's broadcasting rules
for binary operators.
}];
let arguments = (ins
TensorOf<[BF16, F16, F32, F64, I16, I32, I64, I8, TF_Complex128, TF_Complex64, TF_Qint32, TF_Qint8, TF_Quint8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8]>:$lhs,
TensorOf<[BF16, F16, F32, F64, I16, I32, I64, I8, TF_Complex128, TF_Complex64, TF_Qint32, TF_Qint8, TF_Quint8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8]>:$rhs,
TF_I32OrI64Tensor:$broadcast_dims
);
let results = (outs
TensorOf<[BF16, F16, F32, F64, I16, I32, I64, I8, TF_Complex128, TF_Complex64, TF_Qint32, TF_Qint8, TF_Quint8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8]>:$lhs_output,
TensorOf<[BF16, F16, F32, F64, I16, I32, I64, I8, TF_Complex128, TF_Complex64, TF_Qint32, TF_Qint8, TF_Quint8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8]>:$rhs_output
);
TF_DerivedOperandTypeAttr Tindices = TF_DerivedOperandTypeAttr<2>;
TF_DerivedOperandTypeAttr T = TF_DerivedOperandTypeAttr<0>;
}
def TF_XlaConvOp : TF_Op<"XlaConv", [NoSideEffect]> {
let summary = "Wraps the XLA ConvGeneralDilated operator, documented at";
let description = [{
https://www.tensorflow.org/performance/xla/operation_semantics#conv_convolution
.
}];
let arguments = (ins
TensorOf<[BF16, F16, F32, F64, I16, I32, I64, I8, TF_Complex128, TF_Complex64, TF_Qint32, TF_Qint8, TF_Quint8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8]>:$lhs,
TensorOf<[BF16, F16, F32, F64, I16, I32, I64, I8, TF_Complex128, TF_Complex64, TF_Qint32, TF_Qint8, TF_Quint8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8]>:$rhs,
TF_I32OrI64Tensor:$window_strides,
TF_I32OrI64Tensor:$padding,
TF_I32OrI64Tensor:$lhs_dilation,
TF_I32OrI64Tensor:$rhs_dilation,
TF_I32OrI64Tensor:$feature_group_count,
StrAttr:$dimension_numbers,
StrAttr:$precision_config
);
let results = (outs
TensorOf<[BF16, F16, F32, F64, I16, I32, I64, I8, TF_Complex128, TF_Complex64, TF_Qint32, TF_Qint8, TF_Quint8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8]>:$output
);
TF_DerivedOperandTypeAttr Tindices = TF_DerivedOperandTypeAttr<2>;
TF_DerivedOperandTypeAttr T = TF_DerivedOperandTypeAttr<0>;
}
def TF_XlaDotOp : TF_Op<"XlaDot", [NoSideEffect]> {
let summary = "Wraps the XLA DotGeneral operator, documented at";
let description = [{
https://www.tensorflow.org/performance/xla/operation_semantics#dotgeneral
.
}];
let arguments = (ins
TensorOf<[BF16, F16, F32, F64, I16, I32, I64, I8, TF_Complex128, TF_Complex64, TF_Qint32, TF_Qint8, TF_Quint8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8]>:$lhs,
TensorOf<[BF16, F16, F32, F64, I16, I32, I64, I8, TF_Complex128, TF_Complex64, TF_Qint32, TF_Qint8, TF_Quint8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8]>:$rhs,
StrAttr:$dimension_numbers,
StrAttr:$precision_config
);
let results = (outs
TensorOf<[BF16, F16, F32, F64, I16, I32, I64, I8, TF_Complex128, TF_Complex64, TF_Qint32, TF_Qint8, TF_Quint8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8]>:$output
);
TF_DerivedOperandTypeAttr T = TF_DerivedOperandTypeAttr<0>;
}
def TF_XlaDynamicSliceOp : TF_Op<"XlaDynamicSlice", [NoSideEffect]> {
let summary = "Wraps the XLA DynamicSlice operator, documented at";
let description = [{
https://www.tensorflow.org/performance/xla/operation_semantics#dynamicslice
.
DynamicSlice extracts a sub-array from the input array at dynamic
start_indices. The size of the slice in each dimension is passed in
size_indices, which specify the end point of exclusive slice intervals in each
dimension -- [start, start + size). The shape of start_indices must have rank 1,
with dimension size equal to the rank of operand.
}];
let arguments = (ins
TF_Tensor:$input,
TF_I32OrI64Tensor:$start_indices,
TF_I32OrI64Tensor:$size_indices
);
let results = (outs
TF_Tensor:$output
);
TF_DerivedOperandTypeAttr Tindices = TF_DerivedOperandTypeAttr<1>;
TF_DerivedOperandTypeAttr T = TF_DerivedOperandTypeAttr<0>;
}
def TF_XlaDynamicUpdateSliceOp : TF_Op<"XlaDynamicUpdateSlice", [NoSideEffect]> {
let summary = "Wraps the XLA DynamicUpdateSlice operator, documented at";
@ -9522,6 +9626,142 @@ Handling of out-of-bounds slice indices is implementation-defined.
TF_DerivedOperandTypeAttr T = TF_DerivedOperandTypeAttr<0>;
}
def TF_XlaGatherOp : TF_Op<"XlaGather", [NoSideEffect]> {
let summary = "Wraps the XLA Gather operator documented at";
let description = [{
https://www.tensorflow.org/xla/operation_semantics#gather
}];
let arguments = (ins
TensorOf<[BF16, F16, F32, F64, I16, I32, I64, I8, TF_Complex128, TF_Complex64, TF_Qint32, TF_Qint8, TF_Quint8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8]>:$operand,
TF_I32OrI64Tensor:$start_indices,
TF_I32OrI64Tensor:$slice_sizes,
StrAttr:$dimension_numbers,
BoolAttr:$indices_are_sorted
);
let results = (outs
TensorOf<[BF16, F16, F32, F64, I16, I32, I64, I8, TF_Complex128, TF_Complex64, TF_Qint32, TF_Qint8, TF_Quint8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8]>:$output
);
TF_DerivedOperandTypeAttr Tindices = TF_DerivedOperandTypeAttr<1>;
TF_DerivedOperandTypeAttr T = TF_DerivedOperandTypeAttr<0>;
}
def TF_XlaKeyValueSortOp : TF_Op<"XlaKeyValueSort", [NoSideEffect]> {
let summary = "Wraps the XLA Sort operator, documented at";
let description = [{
https://www.tensorflow.org/performance/xla/operation_semantics#sort
.
Sorts a tensor. Currently only sorts in ascending order are supported.
}];
let arguments = (ins
TF_IntOrFpTensor:$keys,
TF_Tensor:$values
);
let results = (outs
TF_IntOrFpTensor:$sorted_keys,
TF_Tensor:$sorted_values
);
TF_DerivedOperandTypeAttr V = TF_DerivedOperandTypeAttr<1>;
TF_DerivedOperandTypeAttr K = TF_DerivedOperandTypeAttr<0>;
}
def TF_XlaPadOp : TF_Op<"XlaPad", [NoSideEffect]> {
let summary = "Wraps the XLA Pad operator, documented at";
let description = [{
https://www.tensorflow.org/performance/xla/operation_semantics#pad
.
}];
let arguments = (ins
TF_Tensor:$input,
TF_Tensor:$padding_value,
TF_I32OrI64Tensor:$padding_low,
TF_I32OrI64Tensor:$padding_high,
TF_I32OrI64Tensor:$padding_interior
);
let results = (outs
TF_Tensor:$output
);
TF_DerivedOperandTypeAttr Tindices = TF_DerivedOperandTypeAttr<2>;
TF_DerivedOperandTypeAttr T = TF_DerivedOperandTypeAttr<0>;
}
def TF_XlaReduceOp : TF_Op<"XlaReduce", [NoSideEffect]> {
let summary = "Wraps the XLA Reduce operator, documented at";
let description = [{
https://www.tensorflow.org/performance/xla/operation_semantics#reduce .
}];
let arguments = (ins
TensorOf<[BF16, F16, F32, F64, I16, I32, I64, I8, TF_Complex128, TF_Complex64, TF_Qint32, TF_Qint8, TF_Quint8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8]>:$input,
TensorOf<[BF16, F16, F32, F64, I16, I32, I64, I8, TF_Complex128, TF_Complex64, TF_Qint32, TF_Qint8, TF_Quint8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8]>:$init_value,
I64ArrayAttr:$dimensions_to_reduce,
SymbolRefAttr:$reducer
);
let results = (outs
TensorOf<[BF16, F16, F32, F64, I16, I32, I64, I8, TF_Complex128, TF_Complex64, TF_Qint32, TF_Qint8, TF_Quint8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8]>:$output
);
TF_DerivedOperandTypeAttr T = TF_DerivedOperandTypeAttr<0>;
}
def TF_XlaReplicaIdOp : TF_Op<"XlaReplicaId", [NoSideEffect]> {
let summary = "Replica ID.";
let description = [{
}];
let arguments = (ins);
let results = (outs
I32Tensor:$id
);
}
def TF_XlaSelfAdjointEigOp : TF_Op<"XlaSelfAdjointEig", [NoSideEffect]> {
let summary = [{
Computes the eigen decomposition of a batch of self-adjoint matrices
}];
let description = [{
(Note: Only real inputs are supported).
Computes the eigenvalues and eigenvectors of the innermost N-by-N matrices in
tensor such that tensor[...,:,:] * v[..., :,i] = e[..., i] * v[...,:,i], for
i=0...N-1.
}];
let arguments = (ins
TensorOf<[BF16, F16, F32, F64, I16, I32, I64, I8, TF_Complex128, TF_Complex64, TF_Qint32, TF_Qint8, TF_Quint8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8]>:$a,
BoolAttr:$lower,
I64Attr:$max_iter,
F32Attr:$epsilon
);
let results = (outs
TensorOf<[BF16, F16, F32, F64, I16, I32, I64, I8, TF_Complex128, TF_Complex64, TF_Qint32, TF_Qint8, TF_Quint8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8]>:$w,
TensorOf<[BF16, F16, F32, F64, I16, I32, I64, I8, TF_Complex128, TF_Complex64, TF_Qint32, TF_Qint8, TF_Quint8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8]>:$v
);
TF_DerivedOperandTypeAttr T = TF_DerivedOperandTypeAttr<0>;
}
def TF_XlaShardingOp : TF_Op<"XlaSharding", [NoSideEffect]> {
let summary = [{
An op which shards the input based on the given sharding attribute.
@ -9541,6 +9781,35 @@ An op which shards the input based on the given sharding attribute.
TF_DerivedOperandTypeAttr T = TF_DerivedOperandTypeAttr<0>;
}
def TF_XlaSvdOp : TF_Op<"XlaSvd", [NoSideEffect]> {
let summary = [{
Computes the eigen decomposition of a batch of self-adjoint matrices
}];
let description = [{
(Note: Only real inputs are supported).
Computes the eigenvalues and eigenvectors of the innermost M-by-N matrices in
tensor such that tensor[...,:,:] = u[..., :, :] * Diag(s[..., :]) * Transpose(v[...,:,:]).
}];
let arguments = (ins
TensorOf<[BF16, F16, F32, F64, I16, I32, I64, I8, TF_Complex128, TF_Complex64, TF_Qint32, TF_Qint8, TF_Quint8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8]>:$a,
I64Attr:$max_iter,
F32Attr:$epsilon,
StrAttr:$precision_config
);
let results = (outs
TensorOf<[BF16, F16, F32, F64, I16, I32, I64, I8, TF_Complex128, TF_Complex64, TF_Qint32, TF_Qint8, TF_Quint8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8]>:$s,
TensorOf<[BF16, F16, F32, F64, I16, I32, I64, I8, TF_Complex128, TF_Complex64, TF_Qint32, TF_Qint8, TF_Quint8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8]>:$u,
TensorOf<[BF16, F16, F32, F64, I16, I32, I64, I8, TF_Complex128, TF_Complex64, TF_Qint32, TF_Qint8, TF_Quint8, TF_Uint16, TF_Uint32, TF_Uint64, TF_Uint8]>:$v
);
TF_DerivedOperandTypeAttr T = TF_DerivedOperandTypeAttr<0>;
}
def TF_Xlog1pyOp : TF_Op<"Xlog1py", [NoSideEffect]> {
let summary = "Returns 0 if x == 0, and x * log1p(y) otherwise, elementwise.";