import torch


def get_numpy(x_picture):
    """ Get numpy array for both cuda and not. """
    if torch.cuda.is_available():
        return x_picture.cpu().data.numpy()

    return x_picture.data.numpy()