Python wrappers
Public Python APIs implemented by this engine symbol.Inverse of flatten — split dim into sizes.
Composite over reshape_op. The product of sizes must equal
a.shape[dim]; the surrounding axes are preserved verbatim. Pure
view operation when the input is contiguous; gradient flows through
ReshapeBackward.
Math
Let a have shape and
sizes with . Then the
output has shape
See Also
reshape_op — the underlying primitive operates on the full shape.
Parameters
aTensorImplPtrSource tensor of rank .
dimintAxis to expand. Negative values wrap modulo
a.ndim.sizesShapeReplacement extents. Their product must equal
a.shape[dim].Returns
TensorImplPtrReshaped tensor whose total numel matches a.
Raises
FailureIf
a is null or .IndexErrorIf
dim is out of range.