def get_tensor_size(tensor):
    """
    Return tensor size. Assumes first dimension is for batch size and is ignored.
    :param tensor: Input tensor
    :return: size of each batch element
    """
    size = 1
    for d in tensor.get_shape()[1:]:
        size = size * d.value
    return size