Skip to content

Process grid tensor by builder.add_transpose makes the function always run on CPU #3

@Tengxu-Sun

Description

@Tengxu-Sun

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions