Skip to content

Commit c26e0ed

Browse files
SiegeLordExtensorflower-gardener
authored andcommitted
Update generated tensor_shape.py
PiperOrigin-RevId: 388353100
1 parent 5f23ee4 commit c26e0ed

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

tensorflow_probability/python/internal/backend/numpy/gen/tensor_shape.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,17 @@ def dimension_at_index(shape, index):
213213

214214
@tf_export(v1=["Dimension"])
215215
class Dimension(object):
216-
"""Represents the value of one dimension in a TensorShape."""
216+
"""Represents the value of one dimension in a TensorShape.
217+
218+
@compatibility(TF2)
219+
In TF2, members of a `TensorShape` object are integers. The `Dimension` class
220+
is not part of TF2's data model.
221+
222+
Please refer to the [TensorShape section of the migration guide]
223+
(https://www.tensorflow.org/guide/migrate/index#tensorshape) on common code
224+
patterns adapting Dimension objects to a TF2 syntax.
225+
@end_compatibility
226+
"""
217227

218228
__slots__ = ["_value"]
219229

0 commit comments

Comments
 (0)