def dense_call_valid

stelliferous@0.0.2.0 · tensor_convolution.bend:220

import stelliferous@0.0.2.0/tensor_convolution.bend as TensorConvolution
import Base
import stelliferous@0.0.2.0/kernel_shape.bend as KernelShape

220# What a dense call needs of its three buffers: lengths that fit the shape and
221# the capacities that hold them.
222def dense_call_valid(+dimensions: KernelShape.Dimensions,+count: U32,+input_length: Nat,+input_depth: Nat,+weight_length: Nat,+weight_depth: Nat,
223  +bias_length: Nat,+bias_depth: Nat) -> Bool:
224  KernelShape.Dimensions{+ci,rows,+h,+w,k,s,p} = dimensions
225  KernelShape.valid(dimensions,Nat.mul(ci,Nat.mul(h,w)),weight_length,bias_length) &&
226    Nat.is_eq(input_length,Nat.mul(U32.to_nat(count),Nat.mul(ci,Nat.mul(h,w)))) &&
227    Nat.is_le(input_length,U32.to_nat(U32.shln(1,input_depth))) &&
228    Nat.is_le(weight_length,U32.to_nat(U32.shln(1,weight_depth))) && Nat.is_le(bias_length,U32.to_nat(U32.shln(1,bias_depth)))

Uses (11)

Used by (1)