import torch
import numpy as np

class QWANField:
    def __init__(self, timeseries):
        if isinstance(timeseries, np.ndarray):
            self.x = torch.tensor(timeseries, dtype=torch.float32, requires_grad=True)
        else:
            self.x = timeseries.clone().detach().requires_grad_(True)

    def get(self):
        return self.x
