Skip to content

Commit

Permalink
Fix build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanwharris committed May 24, 2019
1 parent a22e9ed commit 7f7e23e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
20 changes: 10 additions & 10 deletions tests/callbacks/test_tensor_board.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ def test_writer_closed_on_end_visdom_visdom(self, mock_visdom, mock_writer, _):
self.assertEqual(mock_writer.return_value.close.call_count, 1)

@patch('torchbearer.callbacks.tensor_board.os.makedirs')
@patch('torchbearer.callbacks.tensor_board.utils.make_grid')
@patch('torchvision.utils.make_grid')
@patch('tensorboardX.SummaryWriter')
def test_simple_case(self, mock_board, mock_grid, _):
mock_board.return_value = Mock()
Expand All @@ -336,7 +336,7 @@ def test_simple_case(self, mock_board, mock_grid, _):
self.assertTrue(mock_grid.call_args[0][0].size() == state['x'].size())
tboard.on_end({})

@patch('torchbearer.callbacks.tensor_board.utils.make_grid')
@patch('torchvision.utils.make_grid')
@patch('torchbearer.callbacks.tensor_board.os.makedirs')
@patch('tensorboardX.torchvis.VisdomWriter')
@patch('visdom.Visdom')
Expand All @@ -362,7 +362,7 @@ def test_simple_case_visdom(self, mock_visdom, mock_writer, _, mock_grid):
tboard.on_end({})

@patch('torchbearer.callbacks.tensor_board.os.makedirs')
@patch('torchbearer.callbacks.tensor_board.utils.make_grid')
@patch('torchvision.utils.make_grid')
@patch('tensorboardX.SummaryWriter')
def test_multi_batch(self, mock_board, mock_grid, _):
mock_board.return_value = Mock()
Expand All @@ -386,7 +386,7 @@ def test_multi_batch(self, mock_board, mock_grid, _):
self.assertTrue(mock_grid.call_args[0][0].size() == torch.ones(36, 3, 10, 10).size())
tboard.on_end({})

@patch('torchbearer.callbacks.tensor_board.utils.make_grid')
@patch('torchvision.utils.make_grid')
@patch('torchbearer.callbacks.tensor_board.os.makedirs')
@patch('tensorboardX.torchvis.VisdomWriter')
@patch('visdom.Visdom')
Expand All @@ -413,7 +413,7 @@ def test_multi_batch_visdom(self, mock_visdom, mock_writer, _, mock_grid):
tboard.on_end({})

@patch('torchbearer.callbacks.tensor_board.os.makedirs')
@patch('torchbearer.callbacks.tensor_board.utils.make_grid')
@patch('torchvision.utils.make_grid')
@patch('tensorboardX.SummaryWriter')
def test_multi_epoch(self, mock_board, mock_grid, _):
mock_board.return_value = Mock()
Expand All @@ -438,7 +438,7 @@ def test_multi_epoch(self, mock_board, mock_grid, _):
self.assertTrue(mock_grid.call_args[0][0].size() == torch.ones(36, 3, 10, 10).size())
tboard.on_end({})

@patch('torchbearer.callbacks.tensor_board.utils.make_grid')
@patch('torchvision.utils.make_grid')
@patch('torchbearer.callbacks.tensor_board.os.makedirs')
@patch('tensorboardX.torchvis.VisdomWriter')
@patch('visdom.Visdom')
Expand Down Expand Up @@ -466,7 +466,7 @@ def test_multi_epoch_visdom(self, mock_visdom, mock_writer, _, mock_grid):
tboard.on_end({})

@patch('torchbearer.callbacks.tensor_board.os.makedirs')
@patch('torchbearer.callbacks.tensor_board.utils.make_grid')
@patch('torchvision.utils.make_grid')
@patch('tensorboardX.SummaryWriter')
def test_single_channel(self, mock_board, mock_grid, _):
mock_board.return_value = Mock()
Expand All @@ -489,7 +489,7 @@ def test_single_channel(self, mock_board, mock_grid, _):
self.assertTrue(mock_grid.call_args[0][0].size() == torch.ones(18, 1, 10, 10).size())
tboard.on_end({})

@patch('torchbearer.callbacks.tensor_board.utils.make_grid')
@patch('torchvision.utils.make_grid')
@patch('torchbearer.callbacks.tensor_board.os.makedirs')
@patch('tensorboardX.torchvis.VisdomWriter')
@patch('visdom.Visdom')
Expand All @@ -515,7 +515,7 @@ def test_single_channel_visdom(self, mock_visdom, mock_writer, _, mock_grid):
tboard.on_end({})

@patch('torchbearer.callbacks.tensor_board.os.makedirs')
@patch('torchbearer.callbacks.tensor_board.utils.make_grid')
@patch('torchvision.utils.make_grid')
@patch('tensorboardX.SummaryWriter')
def test_odd_batches(self, mock_board, mock_grid, _):
mock_board.return_value = Mock()
Expand All @@ -540,7 +540,7 @@ def test_odd_batches(self, mock_board, mock_grid, _):
self.assertTrue(mock_grid.call_args[0][0].size() == torch.ones(40, 3, 10, 10).size())
tboard.on_end({})

@patch('torchbearer.callbacks.tensor_board.utils.make_grid')
@patch('torchvision.utils.make_grid')
@patch('torchbearer.callbacks.tensor_board.os.makedirs')
@patch('tensorboardX.torchvis.VisdomWriter')
@patch('visdom.Visdom')
Expand Down
2 changes: 1 addition & 1 deletion tests/variational/test_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def test_celeba_hq_use_numpy_loader(self, mock_gi, mock_len, mock_loader):

@patch.object(ds.SimpleImageFolder, '__len__')
@patch.object(ds.SimpleImageFolder, '__getitem__')
@patch('torchbearer.variational.datasets.default_loader')
@patch('torchvision.datasets.folder.default_loader')
def test_celeba_hq_use_default_loader(self, mock_loader, mock_gi, mock_len, ):
import torchvision
mock_len.return_value = 10
Expand Down
2 changes: 1 addition & 1 deletion tests/variational/test_visualisation.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def test_data_key_str(self):

self.assertTrue(lw.data == state['test_key'])

@patch('torchbearer.variational.visualisation.save_image')
@patch('torchvision.utils.save_image')
def test_save_walk(self, mock_save_img):
state = {tb.MODEL: Mock(), tb.X: Mock(), tb.DEVICE: 'cpu'}

Expand Down

0 comments on commit 7f7e23e

Please sign in to comment.