def shared(self, init, name, role=PARAMETER, **kwargs): p = self.params.get(name) if p is None: p = shared_param(init, name, role, **kwargs) self.params[name] = p else: assert p.get_value().shape == np.shape(init) return p
def shared(self, init, name, cast_float32=True, role=PARAMETER, **kwargs): p = self.shareds.get(name) if p is None: p = shared_param(init, name, cast_float32, role, **kwargs) self.shareds[name] = p return p