rand rotation supports 3d inputs only
@@ -93,6 +93,8 @@ class RandomRotationLayer(RandomisedLayer):
return image_3d
assert image_3d.ndim == 3
assert self._transform is not None
+ assert all([dim > 1 for dim in image_3d.shape]), \
+ 'random rotation supports 3D inputs only'
center_ = 0.5 * np.asarray(image_3d.shape, dtype=np.int64)
c_offset = center_ - center_.dot(self._transform)
image_3d[...] = scipy.ndimage.affine_transform(
