def with_metadata

stelliferous@0.0.2.0 · tensor.bend:92

import stelliferous@0.0.2.0/tensor.bend as Tensor
import Base

92# Metadata inspection retains the original layout and affine storage.
93def with_metadata(~Element: Data,~Result: Type,tensor: Tensor<Element>,
94  body: Tensor<Element> -> List<&2,U32> -> Element -> Status -> U32 -> Result) -> Result:
95  match tensor:
96    case Tensor{storage,+shape,+fill,+status,+workers}: body(Tensor{storage,shape,fill,status,workers},shape,fill,status,workers)
97    case Banded{bands,geometry,+shape,+fill,+status,+workers}: body(Banded{bands,geometry,shape,fill,status,workers},shape,fill,status,workers)

Uses (4)

Used by (5)