[docs]classConv(OpRun):def__init__(self,onnx_node:NodeProto,run_params:Dict[str,Any],schema:Any=None):OpRun.__init__(self,onnx_node,run_params,schema)self.cache_:Dict[type,Any]={}def_run(self,X,W,B=None,auto_pad=None,dilations=None,group=None,kernel_shape=None,pads=None,strides=None,):ifX.dtypenotinself.cache_:ifX.dtype==np.float32:rt=ConvFloat()elifX.dtype==np.float64:rt=ConvDouble()else:raiseTypeError(f"No C implementation C for operator 'Conv' and dtype={X.dtype}.")self.cache_[X.dtype]=rtrt.init(auto_pad,np.array(dilationsor[],dtype=np.int64),group,np.array(kernel_shapeor[],dtype=np.int64),np.array(padsor[],dtype=np.int64),np.array(stridesor[],dtype=np.int64),)rt=self.cache_[X.dtype]assertXisnotNone,f"X cannot be None for operator {type(self)}."assert(min(X.shape)!=0),f"Unable to run operator Conv on an empty matrix. X.shape={X.shape!r}."assert(BisNoneormin(B.shape)!=0),f"Unable to run operator Conv on an empty matrix. B.shape={B.shape!r}."cv=rt.compute(X,W,B)return(cv,)