xref: /aosp_15_r20/external/tensorflow/tensorflow/python/ops/structured/BUILD (revision b6fb3261f9314811a0f4371741dbb8839866f948)
1# Structured Tensors
2
3load("//tensorflow:tensorflow.bzl", "py_test")
4
5package(
6    default_visibility = [
7        "//tensorflow:internal",
8        "//tensorflow:structured_tensor_whitelist",
9    ],
10    licenses = ["notice"],
11)
12
13py_library(
14    name = "structured",
15    srcs = ["__init__.py"],
16    srcs_version = "PY3",
17    tags = ["nofixdeps"],
18    deps = [
19        ":structured_ops",
20    ],
21)
22
23py_library(
24    name = "structured_ops",
25    srcs = ["structured_ops.py"],
26    deps = [
27        ":structured_array_ops",
28        ":structured_tensor",
29    ],
30)
31
32py_library(
33    name = "structured_tensor",
34    srcs = [
35        "structured_array_ops.py",
36        "structured_tensor.py",
37    ],
38    srcs_version = "PY3",
39    deps = [
40        "//tensorflow/python:array_ops",
41        "//tensorflow/python:check_ops",
42        "//tensorflow/python:composite_tensor",
43        "//tensorflow/python:constant_op",
44        "//tensorflow/python:control_flow_ops",
45        "//tensorflow/python:dtypes",
46        "//tensorflow/python:framework_ops",
47        "//tensorflow/python:math_ops",
48        "//tensorflow/python:tensor_shape",
49        "//tensorflow/python:tensor_spec",
50        "//tensorflow/python:type_spec",
51        "//tensorflow/python:util",
52        "//tensorflow/python/ops/ragged:ragged_factory_ops",
53        "//tensorflow/python/ops/ragged:ragged_tensor",
54        "//tensorflow/python/ops/ragged:row_partition",
55        "//third_party/py/numpy",
56    ],
57)
58
59py_library(
60    name = "structured_tensor_dynamic",
61    srcs = [
62        "structured_tensor_dynamic.py",
63    ],
64    srcs_version = "PY3",
65    deps = [
66        ":structured_tensor",
67    ],
68)
69
70py_library(
71    name = "structured_array_ops",
72    srcs = [
73        "structured_array_ops.py",
74    ],
75    srcs_version = "PY3",
76    deps = [
77        ":structured_tensor",
78        "//tensorflow/python:array_ops",
79        "//tensorflow/python:check_ops",
80        "//tensorflow/python:composite_tensor",
81        "//tensorflow/python:constant_op",
82        "//tensorflow/python:control_flow_ops",
83        "//tensorflow/python:dtypes",
84        "//tensorflow/python:framework_ops",
85        "//tensorflow/python:math_ops",
86        "//tensorflow/python:tensor_shape",
87        "//tensorflow/python:tensor_spec",
88        "//tensorflow/python:type_spec",
89        "//tensorflow/python:util",
90        "//tensorflow/python/ops/ragged:ragged_factory_ops",
91        "//tensorflow/python/ops/ragged:ragged_tensor",
92        "//tensorflow/python/ops/ragged:row_partition",
93        "//third_party/py/numpy",
94    ],
95)
96
97py_test(
98    name = "structured_tensor_test",
99    srcs = ["structured_tensor_test.py"],
100    python_version = "PY3",
101    deps = [
102        ":structured_array_ops",
103        ":structured_tensor",
104        ":structured_tensor_dynamic",
105        "//tensorflow/python:array_ops",
106        "//tensorflow/python:constant_op",
107        "//tensorflow/python:dtypes",
108        "//tensorflow/python:errors",
109        "//tensorflow/python:framework_ops",
110        "//tensorflow/python:framework_test_lib",
111        "//tensorflow/python:platform_test",
112        "//tensorflow/python:sparse_tensor",
113        "//tensorflow/python:tensor_shape",
114        "//tensorflow/python:tensor_spec",
115        "//tensorflow/python/eager:context",
116        "//tensorflow/python/ops/ragged:ragged_factory_ops",
117        "//tensorflow/python/ops/ragged:ragged_tensor",
118        "//tensorflow/python/ops/ragged:row_partition",
119        "//third_party/py/numpy",
120        "@absl_py//absl/testing:parameterized",
121    ],
122)
123
124py_test(
125    name = "structured_tensor_spec_test",
126    srcs = ["structured_tensor_spec_test.py"],
127    python_version = "PY3",
128    deps = [
129        ":structured_tensor",
130        "//tensorflow/python:framework_ops",
131        "//tensorflow/python:framework_test_lib",
132        "//tensorflow/python:sparse_tensor",
133        "//tensorflow/python:tensor_shape",
134        "//tensorflow/python/framework:type_utils",
135        "//tensorflow/python/ops/ragged:ragged_factory_ops",
136        "//tensorflow/python/ops/ragged:ragged_tensor",
137        "@absl_py//absl/testing:parameterized",
138    ],
139)
140
141py_test(
142    name = "structured_array_ops_test",
143    srcs = ["structured_array_ops_test.py"],
144    python_version = "PY3",
145    deps = [
146        ":structured_array_ops",
147        ":structured_tensor",
148        "//tensorflow/python:array_ops",
149        "//tensorflow/python:constant_op",
150        "//tensorflow/python:dtypes",
151        "//tensorflow/python:errors",
152        "//tensorflow/python:framework_ops",
153        "//tensorflow/python:framework_test_lib",
154        "//tensorflow/python:platform_test",
155        "//tensorflow/python:sparse_tensor",
156        "//tensorflow/python:tensor_shape",
157        "//tensorflow/python:tensor_spec",
158        "//tensorflow/python/eager:context",
159        "//tensorflow/python/ops/ragged:ragged_factory_ops",
160        "//tensorflow/python/ops/ragged:ragged_tensor",
161        "//tensorflow/python/ops/ragged:row_partition",
162        "//third_party/py/numpy",
163        "@absl_py//absl/testing:parameterized",
164    ],
165)
166
167py_test(
168    name = "structured_tensor_slice_test",
169    srcs = ["structured_tensor_slice_test.py"],
170    python_version = "PY3",
171    tags = ["notsan"],  # Times out frequently.
172    deps = [
173        ":structured_tensor",
174        "//tensorflow/python:framework_ops",
175        "//tensorflow/python:framework_test_lib",
176        "//tensorflow/python:sparse_tensor",
177        "//tensorflow/python:tensor_shape",
178        "//tensorflow/python/ops/ragged:ragged_factory_ops",
179        "//tensorflow/python/ops/ragged:ragged_tensor",
180        "@absl_py//absl/testing:parameterized",
181    ],
182)
183