def survey

stelliferous@0.0.2.0 · tensor_layout.bend:298

import stelliferous@0.0.2.0/tensor_layout.bend as TensorLayout
import Base
import stelliferous@0.0.2.0/tensor.bend as Tensors

298# Summarizes the extents of every part and returns the parts in order.
299def survey(~Element: Data,parts: Tensors.Parts<Element>,+first: List<&2,U32>,+axis: Nat,summary: Survey) -> Tensors.Parts<Element> & Survey:
300  match parts:
301    case Tensors.Single{tensor}:
302      Tensors.with_metadata(~Element,~(Tensors.Parts<Element> & Survey),tensor,tensor => shape => fill => status => workers =>
303        +shape = shape
304        +status = status
305        +workers = workers
306        (Tensors.Single{tensor},surveyed(summary,first,shape,axis,status,workers)))
307    case Tensors.Cons{tensor,rest}:
308      Tensors.with_metadata(~Element,~(Tensors.Parts<Element> & Survey),tensor,tensor => shape => fill => status => workers =>
309        +shape = shape
310        +status = status
311        +workers = workers
312        prepend_survey(~Element,tensor,survey(~Element,rest,first,axis,surveyed(summary,first,shape,axis,status,workers))))

Uses (10)

Used by (1)