Trying to run FOM model on iOS but got following error
2021-03-22 19:43:00.122800+0300 Test[4525:1169258] Metal GPU Frame Capture Enabled
2021-03-22 19:43:00.123248+0300 Test[4525:1169258] Metal API Validation Enabled
2021-03-22 19:43:00.242356+0300 Test[4525:1169477] fopen failed for data file: errno = 2 (No such file or directory)
2021-03-22 19:43:00.242415+0300 Test[4525:1169477] Errors found! Invalidating cache...
2021-03-22 19:43:00.269292+0300 Test[4525:1169477] fopen failed for data file: errno = 2 (No such file or directory)
2021-03-22 19:43:00.269342+0300 Test[4525:1169477] Errors found! Invalidating cache...
sample at time CMTime(value: 0, timescale: 1000, flags: __C.CMTimeFlags(rawValue: 1), epoch: 0)
2021-03-22 19:43:02.301383+0300 Test[4525:1169258] The following operation failed in the TorchScript interpreter.
Traceback of TorchScript, serialized code (most recent call last):
  File "code/__torch__/modules/fom/___torch_mangle_305.py", line 53, in forward
    input0: Tensor,
    input1: Tensor) -> Tensor:
    out = torch.constant_pad_nd(input, [6, 6, 6, 6], 0)
          ~~~~~~~~~~~~~~~~~~~~~ <--- HERE
    _0 = getattr(self, "prepack_folding._jit_pass_packed_weight_0")
    _1 = ops.metal_prepack.conv2d_run(out, _0)

Traceback of TorchScript, original code (most recent call last):
/python3.8/site-packages/torch/nn/functional.py(3997): _pad
development/first-order-model/first-order-model-my/modules/util.py(241): forward
/python3.8/site-packages/torch/nn/modules/module.py(860): _slow_forward
/python3.8/site-packages/torch/nn/modules/module.py(887): _call_impl
development/first-order-model/first-order-model-my/modules/keypoint_detector.py(51): forward
/python3.8/site-packages/torch/nn/modules/module.py(860): _slow_forward
/python3.8/site-packages/torch/nn/modules/module.py(887): _call_impl
development/first-order-model/first-order-model-my/modules/fom.py(69): forward
/python3.8/site-packages/torch/nn/modules/module.py(860): _slow_forward
/python3.8/site-packages/torch/nn/modules/module.py(887): _call_impl
/python3.8/site-packages/torch/jit/_trace.py(934): trace_module
/python3.8/site-packages/torch/jit/_trace.py(733): trace
development/first-order-model/first-order-model-my/convert.py(75): make_animation
development/first-order-model/first-order-model-my/convert.py(112): <module>
RuntimeError: 'memory_format' argument is incompatible with Metal tensor

On CPU backend model works fine. How can I fix or bypass this issue? @xta0