Example #1
0
 def reset_anchors(self, alloc_size):
     self._alloc_size = alloc_size
     anchors = self._generate_anchors(self._sizes, self._ratios, self._step, self._alloc_size, self._offsets)
     self._reg_params.pop('anchors')
     self.anchors = gluon.Constant(self._key, anchors)
     self.params._params[self.prefix + self._key] = self.anchors
     self.anchors.initialize()
 def __init__(self):
     super(Foo, self).__init__()
     self.weight = gluon.Constant(const_arr)
Example #3
0
 def __init__(self, num_hidden: int, ndim: int = 2) -> None:
     super().__init__()
     self.scale = gluon.Constant(
         np.ones(shape=tuple([num_hidden] + [1] * (ndim - 1))))
     self._axis_arg = tuple(range(1, ndim))