Open3D (C++ API)
|
Functions | |
const SizeVector | ExpandFrontDims (const SizeVector &shape, int64_t ndims) |
bool | IsCompatibleBroadcastShape (const SizeVector &l_shape, const SizeVector &r_shape) |
Returns true if two shapes are compatible for broadcasting. More... | |
SizeVector | BroadcastedShape (const SizeVector &l_shape, const SizeVector &r_shape) |
Returns the broadcasted shape of two shapes. More... | |
bool | CanBeBrocastedToShape (const SizeVector &src_shape, const SizeVector &dst_shape) |
Returns true if src_shape can be brocasted to dst_shape . More... | |
SizeVector | ReductionShape (const SizeVector &src_shape, const SizeVector &dims, bool keepdim) |
Returns the shape after reduction. More... | |
int64_t | WrapDim (int64_t dim, int64_t max_dim) |
Wrap around negative dim . More... | |
SizeVector | InferShape (SizeVector shape, int64_t num_elements) |
SizeVector open3d::shape_util::BroadcastedShape | ( | const SizeVector & | l_shape, |
const SizeVector & | r_shape | ||
) |
bool open3d::shape_util::CanBeBrocastedToShape | ( | const SizeVector & | src_shape, |
const SizeVector & | dst_shape | ||
) |
Returns true if src_shape
can be brocasted to dst_shape
.
E.g. CanBeBrocastedToShape({1, 2}, {3, 5, 2}) -> true CanBeBrocastedToShape({1, 2}, {3, 5, 3}) -> false
src_shape | Source tensor shape. |
dst_shape | Destination tensor shape. |
src_shape
can be brocasted to dst_shape
. const SizeVector open3d::shape_util::ExpandFrontDims | ( | const SizeVector & | shape, |
int64_t | ndims | ||
) |
Expand a shape with ones in front. Returning a shape with size of ndims. E.g. ExpandFrontDims({2, 3}, 5) == {1, 1, 1, 2, 3}
SizeVector open3d::shape_util::InferShape | ( | SizeVector | shape, |
int64_t | num_elements | ||
) |
bool open3d::shape_util::IsCompatibleBroadcastShape | ( | const SizeVector & | l_shape, |
const SizeVector & | r_shape | ||
) |
Returns true if two shapes are compatible for broadcasting.
E.g. IsCompatibleBroadcastShape({3, 1, 2}, {5, 1}) -> true IsCompatibleBroadcastShape({3, 1, 2}, {5, 3}) -> false
l_shape
and r_shape
are compatible for broadcasting. SizeVector open3d::shape_util::ReductionShape | ( | const SizeVector & | src_shape, |
const SizeVector & | dims, | ||
bool | keepdim | ||
) |
Returns the shape after reduction.
E.g. CanBeBrocastedToShape({1, 2}, {3, 5, 2}) -> true CanBeBrocastedToShape({1, 2}, {3, 5, 3}) -> false
src_shape | shape to reduce |
dims | A list of dimensions to be reduced. |
keepdim | If true, the reduced dims will be retained as size 1. |
int64_t open3d::shape_util::WrapDim | ( | int64_t | dim, |
int64_t | max_dim | ||
) |
Wrap around negative dim
.
E.g. If max_dim == 5, dim -1 will be converted to 4.