|View source on GitHub|
Computes the shape of a broadcast given known shapes.
Compat aliases for migration
See Migration guide for more details.
tf.broadcast_static_shape( shape_x, shape_y )
shape_y are fully known
TensorShapes this computes a
TensorShape which is the shape of the result of a broadcasting op applied in tensors of shapes
For example, if shape_x is
TensorShape([1, 2, 3]) and shape_y is
TensorShape([5, 1, 3]), the result is a TensorShape whose value is
TensorShape([5, 2, 3]).
This is useful when validating the result of a broadcasting operation when the tensors have statically known shapes.
shape_x = tf.TensorShape([1, 2, 3]) shape_y = tf.TensorShape([5, 1 ,3]) tf.broadcast_static_shape(shape_x, shape_y) TensorShape([5, 2, 3])
| || A |
| || A |
| A |
| ||If the two shapes can not be broadcasted.|
© 2020 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.