//clika-runtime/io.clika.runtime/Ops/expand
expand
[common]
fun expand(input: Tensor, shape: LongArray, bidirectional: Boolean = false): Tensor
expand(input: Tensor, shape: LongArray, bidirectional: Boolean = false): the expand operator. Broadcast input to a larger shape WITHOUT copying. Size-1 dims stretch to their target; leading target dims with no input counterpart broadcast; -1 keeps the input's extent at that position. Extents are literals or 0-D integer Tensors (trace symbolically). With bidirectional = true the aligned dims broadcast BOTH ways (the ONNX Expand rule): a target extent of 1 against a non-1 input dim keeps the input dim (the pairwise max) instead of raising. The default is the strict directed form (broadcast_to). Returns a VIEW: every stretched position aliases ONE stored element; treat the result as read-only (or contiguous it to materialize).