Hi there, here’s the result with TORCH_SHOW_CPP_STACKTRACES=1  before python main.py, and I think it started from l10,
( h10 = self.activation(self.l10(h9)))
which the first layer of convolution if you do loss back propagation,
Warning: Traceback of forward call that caused the error:
  File "NP_PROV_train.py", line 55, in <module>
    mean, var = convcnp(x_context.to(device), y_context.to(device), x_target.to(device))
  File "/home/xuesongwang/venv_torch/lib/python3.6/site-packages/torch/nn/modules/module.py", line 532, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/xuesongwang/PycharmProject/Fluctuation_Resistant_Neural_Process/module/NP_PROV.py", line 508, in forward
    h = self.rho(h)
  File "/home/xuesongwang/venv_torch/lib/python3.6/site-packages/torch/nn/modules/module.py", line 532, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/xuesongwang/PycharmProject/Fluctuation_Resistant_Neural_Process/module/NP_PROV.py", line 246, in forward
    h10 = self.activation(self.l10(h9))
  File "/home/xuesongwang/venv_torch/lib/python3.6/site-packages/torch/nn/modules/module.py", line 532, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/xuesongwang/venv_torch/lib/python3.6/site-packages/torch/nn/modules/conv.py", line 778, in forward
    output_padding, self.groups, self.dilation)
 (print_stack at /pytorch/torch/csrc/autograd/python_anomaly_mode.cpp:57)
  0%|                                                                                                            | 0/200000 [00:00<?, ?it/s]
Traceback (most recent call last):
  File "NP_PROV_train.py", line 58, in <module>
    loss.backward()
  File "/home/xuesongwang/venv_torch/lib/python3.6/site-packages/torch/tensor.py", line 195, in backward
    torch.autograd.backward(self, gradient, retain_graph, create_graph)
  File "/home/xuesongwang/venv_torch/lib/python3.6/site-packages/torch/autograd/__init__.py", line 99, in backward
    allow_unreachable=True)  # allow_unreachable flag
RuntimeError: ones needs to be contiguous