def apply_view_context

stelliferous@0.0.2.0 · tensor.bend:401

import stelliferous@0.0.2.0/tensor.bend as Tensor
import Base
import stelliferous@0.0.2.0/storage_buffer.bend as Storage
import stelliferous@0.0.2.0/tensor_view.bend as Views
import stelliferous@0.0.2.0/tensor_operations.bend as Operations

401def apply_view_context(~Element: Data,~Context: Data,~mapper: @+count: Nat -> @+position: U32 -> @+context: Context -> Storage.Buffer<Element> -> Storage.Buffer<Element>,context: Context,name: String,view: Maybe<&2,Views.View>,storage: Storage.Buffer<Element>,+shape: List<&2,U32>,+fill: Element,
402  +workers: U32) -> Tensor<Element>:
403  match view:
404    case Some{view}: applied(~Element,name,shape,fill,workers,Operations.apply_context(~Element,~Context,~mapper,context,storage,view))
405    case None{}: Tensor{storage,shape,fill,Failed{Problem{name,InvalidShape{shape}}},workers}

Uses (13)

Used by (1)