When does ONNX decide to include a Gather op?

943 Views Asked by At

Obscure question, I suppose, but I have a PyTorch model that I've just built, and it's failing to convert to CoreML because ONNX has added Gather ops. The complete model is actually an amalgamation of two separate models, intended to improve performance by keeping the processing on the GPU/Metal for as long as possible.

Building this "composite" model required me to create a couple of slices, of the form x = y[:, 0], and I'm wondering if these might be the reason for the Gather ops?

I do realize I can create a custom layer, but I've just been through a horrible fiasco with custom layers in CoreML, that wasted many, many hours, and got me nowhere, so I'm trying to find another way around the problem.

If finding a way around those slices would prevent ONNX from adding Gather I'd be willing to search for a solution.

Any thoughts appreciated.

0

There are 0 best solutions below