38 namespace shape_util {
49 const SizeVector& r_shape);
59 const SizeVector& r_shape);
69 const SizeVector& dst_shape);
79 const SizeVector& dims,
90 int64_t
WrapDim(int64_t dim, int64_t max_dim,
bool inclusive =
false);
98 SizeVector
InferShape(SizeVector shape, int64_t num_elements);
101 SizeVector
Concat(
const SizeVector& l_shape,
const SizeVector& r_shape);
104 SizeVector
Iota(int64_t n);
SizeVector BroadcastedShape(const SizeVector &l_shape, const SizeVector &r_shape)
Returns the broadcasted shape of two shapes.
Definition: ShapeUtil.cpp:75
SizeVector Concat(const SizeVector &l_shape, const SizeVector &r_shape)
Concatenate two shapes.
Definition: ShapeUtil.cpp:218
SizeVector ReductionShape(const SizeVector &src_shape, const SizeVector &dims, bool keepdim)
Returns the shape after reduction.
Definition: ShapeUtil.cpp:118
int64_t WrapDim(int64_t dim, int64_t max_dim, bool inclusive)
Wrap around negative dim.
Definition: ShapeUtil.cpp:150
SizeVector InferShape(SizeVector shape, int64_t num_elements)
Definition: ShapeUtil.cpp:169
bool IsCompatibleBroadcastShape(const SizeVector &l_shape, const SizeVector &r_shape)
Returns true if two shapes are compatible for broadcasting.
Definition: ShapeUtil.cpp:51
bool CanBeBrocastedToShape(const SizeVector &src_shape, const SizeVector &dst_shape)
Returns true if src_shape can be brocasted to dst_shape.
Definition: ShapeUtil.cpp:109
Definition: PinholeCameraIntrinsic.cpp:35
SizeVector Iota(int64_t n)
Returns a SizeVector of {0, 1, ..., n - 1}, similar to std::iota.
Definition: ShapeUtil.cpp:224