def lead
stelliferous@0.0.2.0 · tensor_layout.bend:373
import stelliferous@0.0.2.0/tensor_layout.bend as TensorLayout
import Base
import stelliferous@0.0.2.0/tensor.bend as Tensors
373def lead(~Element: Data,parts: Tensors.Parts<Element>) -> Tensors.Parts<Element> & (List<&2,U32> & Element):
374 match parts:
375 case Tensors.Single{tensor}:
376 Tensors.with_metadata(~Element,~(Tensors.Parts<Element> & (List<&2,U32> & Element)),tensor,tensor => shape => fill => status => workers =>
377 +shape = shape
378 +fill = fill
379 (Tensors.Single{tensor},(shape,fill)))
380 case Tensors.Cons{tensor,rest}:
381 Tensors.with_metadata(~Element,~(Tensors.Parts<Element> & (List<&2,U32> & Element)),tensor,tensor => shape => fill => status => workers =>
382 +shape = shape
383 +fill = fill
384 (Tensors.Cons{tensor,rest},(shape,fill)))