Skip to content

Commit

Permalink
[fbsync] Use torch.testing.assert_close in test_transforms_video.py (#…
Browse files Browse the repository at this point in the history
…3886)

Summary: Co-authored-by: Philip Meier <github.pmeier@posteo.de>

Reviewed By: vincentqb, cpuhrsch

Differential Revision: D28679968

fbshipit-source-id: cc92cfa4eb77ad740f671a49c4a4aa0d92764230
  • Loading branch information
datumbox authored and facebook-github-bot committed May 25, 2021
1 parent 3e87b01 commit a71b537
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/test_transforms_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import random
import numpy as np
import warnings
from _assert_utils import assert_equal

try:
from scipy import stats
Expand Down Expand Up @@ -120,7 +121,7 @@ def samples_from_standard_normal(tensor):
# Checking the optional in-place behaviour
tensor = torch.rand((3, 128, 16, 16))
tensor_inplace = transforms.NormalizeVideo((0.5, 0.5, 0.5), (0.5, 0.5, 0.5), inplace=True)(tensor)
self.assertTrue(torch.equal(tensor, tensor_inplace))
assert_equal(tensor, tensor_inplace)

transforms.NormalizeVideo((0.5, 0.5, 0.5), (0.5, 0.5, 0.5), inplace=True).__repr__()

Expand Down

0 comments on commit a71b537

Please sign in to comment.