Exemplo n.º 1
0
 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
Exemplo n.º 2
0
 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
Exemplo n.º 3
0
 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
Exemplo n.º 4
0
 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