def test_value_range_loss_zero(self): torch.manual_seed(0) input = torch.rand(1, 3, 128, 128) actual = F.value_range_loss(input) desired = 0.0 self.assertFloatAlmostEqual(actual, desired)
def test_value_range_loss_zero(): torch.manual_seed(0) input = torch.rand(1, 3, 128, 128) actual = F.value_range_loss(input) desired = 0.0 assert desired == ptu.approx(actual)
def test_ValueRangeOperator_call(): torch.manual_seed(0) image = torch.randn(1, 3, 128, 128) op = ops.ValueRangeOperator() actual = op(image) desired = F.value_range_loss(image) ptu.assert_allclose(actual, desired)
def test_ValueRangeOperator_call(self): torch.manual_seed(0) image = torch.randn(1, 3, 128, 128) op = ops.ValueRangeOperator() actual = op(image) desired = F.value_range_loss(image) self.assertTensorAlmostEqual(actual, desired)