import torch


def np_to_integratable_type_1D(x, device):
    """Converts 1D np array to integratable type for use in this library"""
    shape = x.shape
    assert len(shape) == 1, ("Expected 1D array, got ", x)
    return torch.tensor(x, requires_grad=True, dtype=torch.float32).view(1, shape[0]).to(device)