def __init__(self, shape, padding=None): self.shape = shape if padding is None: padding = tuple((0, 0) for _ in self.shape) elif isinstance(padding, int): padding = tuple((padding, padding) for _ in self.shape) self.padding = padding assert len(self.padding) == len(self.shape) check_class_hints(self)
def __init__(self, *, i: Conv2DInParams, f: Conv2DFiltParams, p: int, p_out: int, s: int): self.i = check_type(i, Conv2DInParams, "i") self.f = check_type(f, Conv2DFiltParams, "f") self.p = p self.p_out = p_out self.s = s self.o = self.get_out_params() if self.i.d != self.f.d: raise ValueError( "input d=%d and filter d=%d parameters do not match", (self.i.d, self.f.d), ) check_class_hints(self)
def __init__(self, *, w, h, d): self.w = w self.h = h self.d = d check_class_hints(self)
def __init__(self, *, w, h, d, l): self.w = w self.h = h self.d = d self.l = l check_class_hints(self)