def band_count

stelliferous@0.0.2.0 · tensor_window.bend:89

import stelliferous@0.0.2.0/tensor_window.bend as TensorWindow
import Base
import stelliferous@0.0.2.0/tensor_access.bend as Access
import stelliferous@0.0.2.0/tensor.bend as Tensors
import stelliferous@0.0.2.0/tensor_band.bend as Bands

89# The band route needs the same counts as the dense route: the planes swept
90# along the columns and the output.
91def band_count(~Element: Data,~operation: Element -> Element -> Element,name: String,valid: Bool,planes: Maybe<&2,U32>,count: Maybe<&2,U32>,+pad: Element,+pool: Access.Pool,+geometry: Bands.Geometry,bands: Bands.Bands(~Element),
92  +shape: List<&2,U32>,out_shape: List<&2,U32>,+fill: Element,+workers: U32) -> Tensors.Tensor<Element>:
93  match valid planes count pool:
94    case True{} Some{planes} Some{count} pool: band_execute(~Element,~operation,pad,pool,geometry,bands,out_shape,fill,workers)
95    case valid planes count Access.Pool{height,width,kernel,stride,padding,oh,ow}:
96      Tensors.with_dense(~Element,~Tensors.Tensor<Element>,Tensors.Banded{bands,geometry,shape,fill,Tensors.Usable{},workers},storage => shape => fill => status => workers =>
97        pool_status(~Element,~operation,name,status,pad,kernel,stride,padding,storage,shape,fill,workers))

Uses (13)

Used by (1)