def get_spatial_dim(tensor):
    ' Return spatial dim of the input tensor (without channels and batch dimension).\n\n    Parameters\n    ----------\n    tensor : tf.Tensor\n\n    Returns\n    -------\n    dim : int\n    '
    return (len(tensor.get_shape().as_list()) - 2)
Return spatial dim of the input tensor (without channels and batch dimension).

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

Returns
-------
dim : int
def get_spatial_dim(tensor):
    ' Return spatial dim of the input tensor (without channels and batch dimension).\n\n    Parameters\n    ----------\n    tensor : tf.Tensor\n\n    Returns\n    -------\n    dim : int\n    '
    return (len(tensor.get_shape().as_list()) - 2)