coremltools icon indicating copy to clipboard operation
coremltools copied to clipboard

Support for torch.Tensor.unfold or torch.nn.Unfold

Open Russell-Izadi-Bose opened this issue 4 years ago • 2 comments

❓Question

Is there any plan for adding unfold ops or is there an alternative to perform such operation?

Russell-Izadi-Bose avatar Dec 09 '21 22:12 Russell-Izadi-Bose

Hi! Any updates?

IlyaKrotov avatar Jan 28 '22 15:01 IlyaKrotov

Hello. Will this be implemented?

Karllas avatar Aug 04 '22 04:08 Karllas

Is there any plan for implementing this operator?

memset-c avatar Nov 18 '22 09:11 memset-c

Supporting torch.Tensor.unfold with our current set of MIL ops might be a bit tricky. One idea is to use a convolution followed by an interleave concat. The stride of the convolution would be equal to step. The size of the kernels should be size.

Supporting torch.nn.Unfold seem a little different. However using a convolution here too is probably also the key.

If anyone can help me fill in the details here, please let me know.

TobyRoseman avatar Nov 19 '22 00:11 TobyRoseman

Unless I am missing something, coremltools currently only supports torch.nn.functional.unfold. It would be pretty great to have the more general Tensor.unfold too though.

fwcd avatar May 13 '23 02:05 fwcd

Unless I am missing something, coremltools currently only supports torch.nn.functional.unfold. It would be pretty great to have the more general Tensor.unfold too though.

Yes, I think that's correct; Tensor.unfold is still not supported. Please create a new issue with a minimal PyTorch model that fails to convert because Tensor.unfold is not supported.

TobyRoseman avatar May 15 '23 17:05 TobyRoseman