1 | /* Copyright 2021 The TensorFlow Authors. All Rights Reserved. |
2 | |
3 | Licensed under the Apache License, Version 2.0 (the "License"); |
4 | you may not use this file except in compliance with the License. |
5 | You may obtain a copy of the License at |
6 | |
7 | http://www.apache.org/licenses/LICENSE-2.0 |
8 | |
9 | Unless required by applicable law or agreed to in writing, software |
10 | distributed under the License is distributed on an "AS IS" BASIS, |
11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
12 | See the License for the specific language governing permissions and |
13 | limitations under the License. |
14 | ==============================================================================*/ |
15 | |
16 | #include "tensorflow/core/framework/common_shape_fns.h" |
17 | #include "tensorflow/core/framework/op.h" |
18 | |
19 | namespace tensorflow { |
20 | |
21 | REGISTER_OP("XlaSplitND" ) |
22 | .Input("input: T" ) |
23 | .Output("outputs: N * T" ) |
24 | .Attr("T: type" ) |
25 | .Attr("N: int >= 1" ) |
26 | .Attr("num_splits: list(int)" ) |
27 | .Attr("paddings: list(int) = []" ) |
28 | // TODO(lyandy): Define shape inference function. |
29 | .SetShapeFn(shape_inference::UnknownShape); |
30 | |
31 | REGISTER_OP("XlaConcatND" ) |
32 | .Input("inputs: N * T" ) |
33 | .Output("output: T" ) |
34 | .Attr("T: type" ) |
35 | .Attr("N: int >= 1" ) |
36 | .Attr("num_concats: list(int)" ) |
37 | .Attr("paddings: list(int) = []" ) |
38 | // TODO(lyandy): Define shape inference function. |
39 | .SetShapeFn(shape_inference::UnknownShape); |
40 | |
41 | REGISTER_OP("ReadVariableXlaSplitND" ) |
42 | .Input("resource: resource" ) |
43 | .Output("outputs: N * T" ) |
44 | .Attr("T: type" ) |
45 | .Attr("N: int >= 1" ) |
46 | .Attr("num_splits: list(int)" ) |
47 | .Attr("paddings: list(int) = []" ) |
48 | // TODO(lyandy): Define shape inference function. |
49 | .SetShapeFn(shape_inference::UnknownShape); |
50 | |
51 | REGISTER_OP("AssignVariableXlaConcatND" ) |
52 | .Input("resource: resource" ) |
53 | .Input("inputs: N * T" ) |
54 | .Attr("T: type" ) |
55 | .Attr("N: int >= 1" ) |
56 | .Attr("num_concats: list(int)" ) |
57 | .Attr("paddings: list(int) = []" ) |
58 | .SetShapeFn(shape_inference::NoOutputs); |
59 | |
60 | } // namespace tensorflow |
61 | |