@classmethod
def spatial_dim(cls, tensor):
    """ Return spatial dim of the input tensor (without channels and batch dimension)

        Parameters
        ----------
        tensor : tf.Tensor

        Returns
        -------
        dim : int
        """
    return len(tensor.get_shape().as_list()) - 2
