def get_num_dims(tensor):
    ' Return a number of semantic dimensions (i.e. excluding batch and channels axis)'
    shape = get_shape(tensor)
    dim = len(shape)
    return max(1, (dim - 2))
Return a number of semantic dimensions (i.e. excluding batch and channels axis)
def get_num_dims(tensor):
    ' '
    shape = get_shape(tensor)
    dim = len(shape)
    return max(1, (dim - 2))