Skip to content

Commit 50eac98

Browse files
andylytensorflower-gardener
authored andcommitted
Move tf.MlirLocalVarOp and tf.TPUReshardVariables from tf_ops.td to tf_generated_ops.td (NFC).
PiperOrigin-RevId: 330760386 Change-Id: I99c9d6d7c77db6619b04cf0d093694dff2b2ce19
1 parent 5657bcd commit 50eac98

2 files changed

Lines changed: 38 additions & 38 deletions

File tree

‎tensorflow/compiler/mlir/tensorflow/ir/tf_generated_ops.td‎

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6546,6 +6546,21 @@ pad(t, paddings) ==> [[2, 1, 1, 2, 3, 3, 2]
65466546
TF_DerivedOperandTypeAttr Tpaddings = TF_DerivedOperandTypeAttr<1>;
65476547
}
65486548

6549+
def TF_MlirLocalVarOp : TF_Op<"MlirLocalVarOp", []> {
6550+
let summary = "Creates a handle to an in-scope variable.";
6551+
6552+
let description = [{
6553+
Used by internal passes for temporary representation of local state, which will
6554+
be eventually removed.
6555+
}];
6556+
6557+
let arguments = (ins);
6558+
6559+
let results = (outs
6560+
Res<TF_ResourceTensor, "", [TF_VariableAlloc]>:$resource
6561+
);
6562+
}
6563+
65496564
def TF_MlirPassthroughOp : TF_Op<"MlirPassthroughOp", [NoSideEffect]> {
65506565
let summary = [{
65516566
Wraps an arbitrary MLIR computation expressed as a module with a main() function.
@@ -11604,6 +11619,29 @@ The above computation has a replicated output of two replicas.
1160411619
TF_DerivedOperandTypeAttr T = TF_DerivedOperandTypeAttr<0>;
1160511620
}
1160611621

11622+
def TF_TPUReshardVariablesOp : TF_Op<"TPUReshardVariables", []> {
11623+
let summary = [{
11624+
Op that reshards on-device TPU variables to specified state. Internal use only.
11625+
}];
11626+
11627+
let description = [{
11628+
The sharding state is represented as the key of the compilation that generated
11629+
the sharding/unsharding programs along with the main program. new_format_key
11630+
specifies the desired state, and format_state_var is the current state of the
11631+
variables.
11632+
}];
11633+
11634+
let arguments = (ins
11635+
Arg<Variadic<TF_ResourceTensor>, "", [TF_VariableRead,TF_VariableWrite]>:$vars,
11636+
TF_StrTensor:$new_format_key,
11637+
Arg<TF_ResourceTensor, "", [TF_VariableRead,TF_VariableWrite]>:$format_state_var
11638+
);
11639+
11640+
let results = (outs);
11641+
11642+
TF_DerivedOperandSizeAttr N = TF_DerivedOperandSizeAttr<0>;
11643+
}
11644+
1160711645
def TF_TanOp : TF_Op<"Tan", [NoSideEffect, SameOperandsAndResultType]> {
1160811646
let summary = "Computes tan of x element-wise.";
1160911647

‎tensorflow/compiler/mlir/tensorflow/ir/tf_ops.td‎

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1375,44 +1375,6 @@ Both input and output have a range `(-inf, inf)`.
13751375
let hasCanonicalizer = 1;
13761376
}
13771377

1378-
def TF_MlirLocalVarOp : TF_Op<"MlirLocalVarOp", []> {
1379-
let summary = "Creates a handle to an in-scope variable.";
1380-
1381-
let description = [{
1382-
Used by internal passes for temporary representation of local state, which will
1383-
be eventually removed.
1384-
}];
1385-
1386-
let arguments = (ins);
1387-
1388-
let results = (outs
1389-
Res<TF_ResourceTensor, "", [TF_VariableAlloc]>:$resource
1390-
);
1391-
}
1392-
1393-
def TF_TPUReshardVariablesOp : TF_Op<"TPUReshardVariables", []> {
1394-
let summary = [{
1395-
Op that reshards on-device TPU variables to specified state. Internal use only.
1396-
}];
1397-
1398-
let description = [{
1399-
The sharding state is represented as the key of the compilation that generated
1400-
the sharding/unsharding programs along with the main program. new_format_key
1401-
specifies the desired state, and format_state_var is the current state of the
1402-
variables.
1403-
}];
1404-
1405-
let arguments = (ins
1406-
Arg<Variadic<TF_ResourceTensor>, "", [TF_VariableRead,TF_VariableWrite]>:$vars,
1407-
TF_StrTensor:$new_format_key,
1408-
Arg<TF_ResourceTensor, "", [TF_VariableRead,TF_VariableWrite]>:$format_state_var
1409-
);
1410-
1411-
let results = (outs);
1412-
1413-
TF_DerivedOperandSizeAttr N = TF_DerivedOperandSizeAttr<0>;
1414-
}
1415-
14161378
def TF_StatefulStandardNormalV2Op : TF_Op<"StatefulStandardNormalV2", []> {
14171379
let summary = "Outputs random values from a normal distribution.";
14181380

0 commit comments

Comments
 (0)