def _as_array(data):
    if isinstance(data, (numpy.ndarray, torch.Tensor)):
        return data
    else:
        return numpy.array(data)
def _as_array(data):
    if isinstance(data, (numpy.ndarray, torch.Tensor)):
        return data
    else:
        return numpy.array(data)