Hi, @dneprDroid
I'm trying to implement a 5-D input tensor version of custom grid_sample based on your work. Now i meet two problems hoping you can help me.
First, you said "we should transpose the grid to [n, 2, w, h] shape (for encoding it to a coreml 2-channel texture)". But i found this process may lead to the function always run on CPU in my implementation. The GPU function encode works without this process. I read your code but haven't find a solution. Have you met this problem ever?
Second, since i want implement a 5-D input tensor version of custom grid_sample, how id<MTLTexture> in encode work at this time? I found the data storage is different with ordinary buffer, and i'm not sure how to read data in id<MTLTexture> so that the data can be calculated in later computation process.
Thank you!