@classmethod
def num_channels(cls, tensor, data_format='channels_last'):
    """ Return number of channels in the input tensor

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

        Returns
        -------
        shape : tuple of ints
        """
    shape = tensor.get_shape().as_list()
    axis = cls.channels_axis(data_format)
    return shape[axis]
