backend, device = backend_device
test_data_dir = os.path.dirname(__file__)
data = torch.load(os.path.join(test_data_dir, "test_data_2d.pt"))
x = data["x"]
S = data["Sx"]
J = data["J"]
// we need to reorder S from interleaved (how it"s saved) to o0, o1, o2
// (which is how it"s now computed)
o0, o1, o2 = self.reorder_coefficients_from_interleaved(J, L=8)
reorder = torch.from_numpy(np.concatenate((o0, o1, o2)))
S = S[..., reorder, :, :]
pre_pad = data["pre_pad"]
M = x.shape[2]
After Change
test_data_dir = os.path.dirname(__file__)
with open(os.path.join(test_data_dir, "test_data_2d.npz"), "rb") as f:
buffer = io.BytesIO(f.read())data = np.load(buffer)
x = torch.from_numpy(data["x"])
S = torch.from_numpy(data["Sx"])
J = data["J"]