diff --git a/.ci/docker/requirements-ci.txt b/.ci/docker/requirements-ci.txt index a4672dfbe505..a04575375e92 100644 --- a/.ci/docker/requirements-ci.txt +++ b/.ci/docker/requirements-ci.txt @@ -275,3 +275,8 @@ z3-solver==4.12.2.0 #Description: The Z3 Theorem Prover Project #Pinned versions: #test that import: + +tensorboard==2.13.0 +#Description: Also included in .ci/docker/requirements-docs.txt +#Pinned versions: +#test that import: test_tensorboard diff --git a/.ci/pytorch/win-test.sh b/.ci/pytorch/win-test.sh index 99338313ad84..5d8cc24e4455 100755 --- a/.ci/pytorch/win-test.sh +++ b/.ci/pytorch/win-test.sh @@ -35,7 +35,7 @@ if [[ "$BUILD_ENVIRONMENT" == *cuda* ]]; then fi # TODO: Move both of them to Windows AMI -python -m pip install pytest-rerunfailures==10.3 pytest-cpp==2.3.0 +python -m pip install pytest-rerunfailures==10.3 pytest-cpp==2.3.0 tensorboard==2.13.0 # Install Z3 optional dependency for Windows builds. python -m pip install z3-solver diff --git a/.github/requirements/pip-requirements-macOS.txt b/.github/requirements/pip-requirements-macOS.txt index f33d37f1c61e..696d2f3dac2c 100644 --- a/.github/requirements/pip-requirements-macOS.txt +++ b/.github/requirements/pip-requirements-macOS.txt @@ -25,3 +25,4 @@ sympy==1.11.1 pytest-cpp==2.3.0 rockset==1.0.3 z3-solver==4.12.2.0 +tensorboard==2.13.0 diff --git a/test/test_tensorboard.py b/test/test_tensorboard.py index 82192aab6ce1..aa9517889ab0 100644 --- a/test/test_tensorboard.py +++ b/test/test_tensorboard.py @@ -43,7 +43,14 @@ skipIfNoMatplotlib = unittest.skipIf(not TEST_MATPLOTLIB, "no matplotlib") import torch -from torch.testing._internal.common_utils import TestCase, run_tests, TEST_WITH_ASAN, TEST_WITH_CROSSREF +from torch.testing._internal.common_utils import ( + TestCase, + run_tests, + TEST_WITH_ASAN, + TEST_WITH_CROSSREF, + IS_WINDOWS, + IS_MACOS, +) def tensor_N(shape, dtype=float): numel = np.prod(shape) @@ -406,18 +413,23 @@ def test_video(self): summary.video('dummy', np.random.rand(16, 48, 1, 28, 28)) summary.video('dummy', np.random.rand(20, 7, 1, 8, 8)) + @unittest.skipIf(IS_MACOS, "Skipping on mac, see https://github.com/pytorch/pytorch/pull/109349 ") def test_audio(self): self.assertTrue(compare_proto(summary.audio('dummy', tensor_N(shape=(42,))), self)) + @unittest.skipIf(IS_MACOS, "Skipping on mac, see https://github.com/pytorch/pytorch/pull/109349 ") def test_text(self): self.assertTrue(compare_proto(summary.text('dummy', 'text 123'), self)) + @unittest.skipIf(IS_MACOS, "Skipping on mac, see https://github.com/pytorch/pytorch/pull/109349 ") def test_histogram_auto(self): self.assertTrue(compare_proto(summary.histogram('dummy', tensor_N(shape=(1024,)), bins='auto', max_bins=5), self)) + @unittest.skipIf(IS_MACOS, "Skipping on mac, see https://github.com/pytorch/pytorch/pull/109349 ") def test_histogram_fd(self): self.assertTrue(compare_proto(summary.histogram('dummy', tensor_N(shape=(1024,)), bins='fd', max_bins=5), self)) + @unittest.skipIf(IS_MACOS, "Skipping on mac, see https://github.com/pytorch/pytorch/pull/109349 ") def test_histogram_doane(self): self.assertTrue(compare_proto(summary.histogram('dummy', tensor_N(shape=(1024,)), bins='doane', max_bins=5), self)) @@ -488,6 +500,7 @@ def test_hparams_domain_discrete(self): # only smoke test. Because protobuf map serialization is nondeterministic. summary.hparams(hp, mt, hparam_domain_discrete=hp_domain) + @unittest.skipIf(IS_MACOS, "Skipping on mac, see https://github.com/pytorch/pytorch/pull/109349 ") def test_mesh(self): v = np.array([[[1, 1, 1], [-1, -1, 1], [1, -1, -1], [-1, 1, -1]]], dtype=float) c = np.array([[[255, 0, 0], [0, 255, 0], [0, 0, 255], [255, 0, 255]]], dtype=int) @@ -495,6 +508,7 @@ def test_mesh(self): mesh = summary.mesh('my_mesh', vertices=v, colors=c, faces=f, config_dict=None) self.assertTrue(compare_proto(mesh, self)) + @unittest.skipIf(IS_MACOS, "Skipping on mac, see https://github.com/pytorch/pytorch/pull/109349 ") def test_scalar_new_style(self): scalar = summary.scalar('test_scalar', 1.0, new_style=True) self.assertTrue(compare_proto(scalar, self)) @@ -777,6 +791,8 @@ def test_figure_list(self): writer.close() class TestTensorBoardNumpy(BaseTestCase): + @unittest.skipIf(IS_WINDOWS, "Skipping on windows, see https://github.com/pytorch/pytorch/pull/109349 ") + @unittest.skipIf(IS_MACOS, "Skipping on mac, see https://github.com/pytorch/pytorch/pull/109349 ") def test_scalar(self): res = make_np(1.1) self.assertIsInstance(res, np.ndarray) and self.assertEqual(res.shape, (1,))