Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
felixT2K committed Oct 13, 2023
1 parent 9b3915b commit ec71bd1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/tensorflow/test_models_preprocessor_tf.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@ def test_preprocessor(batch_size, output_size, input_tensor, expected_batches, e
assert all(isinstance(b, tf.Tensor) for b in out)
assert all(b.dtype == tf.float32 for b in out)
assert all(b.shape[1:3] == output_size for b in out)
assert all(tf.math.reduce_all(b == expected_value) for b in out)
assert all(tf.math.reduce_all(tf.math.abs(b - expected_value) < 1e-6) for b in out)
assert len(repr(processor).split("\n")) == 4
4 changes: 2 additions & 2 deletions tests/tensorflow/test_transforms_tf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def test_resize():
input_t = tf.cast(tf.fill([64, 64, 3], 1), dtype=tf.float32)
out = transfo(input_t)

assert tf.reduce_all(out == 1)
assert tf.math.reduce_all(tf.math.abs(out - 1) < 1e-6)
assert out.shape[:2] == output_size
assert repr(transfo) == f"Resize(output_size={output_size}, method='bilinear')"

Expand All @@ -24,7 +24,7 @@ def test_resize():

assert not tf.reduce_all(out == 1)
# Asymetric padding
assert tf.reduce_all(out[-1] == 0) and tf.reduce_all(out[0] == 1)
assert tf.reduce_all(out[-1] == 0) and tf.math.reduce_all(tf.math.abs(out[0] - 1) < 1e-6)
assert out.shape[:2] == output_size

# Symetric padding
Expand Down

0 comments on commit ec71bd1

Please sign in to comment.