Skip to content

Commit

Permalink
device check
Browse files Browse the repository at this point in the history
  • Loading branch information
tomrunia committed Dec 14, 2018
1 parent 0b6514d commit e54981e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions steerable/SCFpyr_PyTorch.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ def build(self, im_batch):
Returns:
pyramid: list containing torch.Tensor objects storing the pyramid
'''

assert im_batch.device == self.device, 'Devices invalid (pyr = {}, batch = {})'.format(self.device, im_batch.device)
assert im_batch.dtype == torch.float32, 'Image batch must be torch.float32'
assert im_batch.dim() == 4, 'Image batch must be of shape [N,C,H,W]'
assert im_batch.shape[1] == 1, 'Second dimension must be 1 encoding grayscale image'
Expand Down

0 comments on commit e54981e

Please sign in to comment.