def band_call_valid
stelliferous@0.0.2.0 · tensor_convolution.bend:285
import stelliferous@0.0.2.0/tensor_convolution.bend as TensorConvolution
import Base
import stelliferous@0.0.2.0/kernel_shape.bend as KernelShape
import stelliferous@0.0.2.0/tensor_band.bend as Bands
285
286
287def band_call_valid(+dimensions: KernelShape.Dimensions,+count: U32,layout: Bands.Geometry,inspection: Bands.Inspection,+weight_length: Nat,+weight_depth: Nat,
288 +bias_length: Nat,+bias_depth: Nat) -> Bool:
289 KernelShape.Dimensions{+ci,rows,+h,+w,k,s,p} = dimensions
290 Bands.Geometry{batch,channels,height,width} = layout
291 Bands.Inspection{valid,first,end,leaves} = inspection
292 valid && U32.is_zero(first) && Nat.is_eq(U32.to_nat(end),Nat.mul(U32.to_nat(count),h)) &&
293 U32.is_eq(batch,count) && Nat.is_eq(U32.to_nat(channels),ci) && Nat.is_eq(U32.to_nat(height),h) && Nat.is_eq(U32.to_nat(width),w) &&
294 KernelShape.valid(dimensions,Nat.mul(ci,Nat.mul(h,w)),weight_length,bias_length) &&
295 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)))