Пример #1
0
 def forward(self, data: List[Tensor],
             state: Dict[str, Any]) -> Union[Tensor, List[Tensor]]:
     return normalize(data, self.mean, self.std, self.max_pixel_value)
Пример #2
0
 def test_normalize_tf_value(self):
     np.testing.assert_array_almost_equal(
         normalize(tf.convert_to_tensor(self.numpy_array), 0.5, 0.31382295,
                   11.0).numpy(), self.expected_result)
Пример #3
0
 def test_normalize_torch_value_int(self):
     np.testing.assert_array_almost_equal(
         normalize(to_tensor(self.numpy_array_int, 'torch'), 0.5,
                   0.31382295, 11.0).numpy(), self.expected_result)
Пример #4
0
 def test_normalize_np_value_int(self):
     np.testing.assert_array_almost_equal(
         normalize(self.numpy_array_int, 0.5, 0.31382295, 11),
         self.expected_result)