Beispiel #1
0
 def _check_input(self, shape_, rate):
     shape_ = self._convert2tensor(shape_)
     rate = self._convert2tensor(rate)
     if shape_.shape != rate.shape:
         shape = np.broadcast(shape_.value, rate.value).shape
         if shape_.shape != shape:
             shape_ = broadcast_to(shape_, shape)
         if rate.shape != shape:
             rate = broadcast_to(rate, shape)
     return shape_, rate
Beispiel #2
0
 def _check_input(self, x, y):
     x = self._convert2tensor(x)
     y = self._convert2tensor(y)
     if x.shape != y.shape:
         shape = np.broadcast(x.value, y.value).shape
         if x.shape != shape:
             x = broadcast_to(x, shape)
         if y.shape != shape:
             y = broadcast_to(y, shape)
     return x, y
Beispiel #3
0
 def _check_input(self, mean, std):
     mean = self._convert2tensor(mean)
     std = self._convert2tensor(std)
     if mean.shape != std.shape:
         shape = np.broadcast(mean.value, std.value).shape
         if mean.shape != shape:
             mean = broadcast_to(mean, shape)
         if std.shape != shape:
             std = broadcast_to(std, shape)
     return mean, std