MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / is_broadcast_compatible

Function is_broadcast_compatible

tensorflow/python/framework/common_shapes.py:562–575  ·  view source on GitHub ↗

Returns True if `shape_x` and `shape_y` are broadcast compatible. Args: shape_x: A `TensorShape` shape_y: A `TensorShape` Returns: True if a shape exists that both `shape_x` and `shape_y` can be broadcasted to. False otherwise.

(shape_x, shape_y)

Source from the content-addressed store, hash-verified

560
561
562def is_broadcast_compatible(shape_x, shape_y):
563 """Returns True if `shape_x` and `shape_y` are broadcast compatible.
564
565 Args:
566 shape_x: A `TensorShape`
567 shape_y: A `TensorShape`
568
569 Returns:
570 True if a shape exists that both `shape_x` and `shape_y` can be broadcasted
571 to. False otherwise.
572 """
573 if shape_x.ndims is None or shape_y.ndims is None:
574 return False
575 return _broadcast_shape_helper(shape_x, shape_y) is not None
576
577
578def broadcast_shape(shape_x, shape_y):

Callers

nothing calls this directly

Calls 1

_broadcast_shape_helperFunction · 0.85

Tested by

no test coverage detected