Example #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
Example #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
Example #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
Example #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