Hello everyone,

i have been implementing my version of the 
[Resampler](https://www.tensorflow.org/addons/api_docs/python/tfa/image/resampler)
 OP (from TF Frontend) to our TVM Stack. 
Now (to my understanding) by adding the "InferCorrectLayout" Attribute to the 
RelayCall Node i should be able to also automatically change the Layout of my 
Custom OP's Inputs/Outputs when the layout is changed for nn.conv2d (see 
[here](https://tvm.apache.org/docs/dev/convert_layout.html).
So my problem is: The Resampler OP has a data tensor of a certain layout (NHWC, 
NCHW etc.) which i want to adapt depending on the desired_layout. But Resampler 
also takes a so called warp tensor with n Dimensions. The same applies for the 
output shape.
In theory i want a layout_transform insertion ONLY on the first input Tensor 
and leave the other input tensor and the output tensor **untouched** with 
regards to its layout. From my intuition 
    
    Array<Array<Layout>> ResamplerInferCorrectLayout(...){
       /*similar code to UpsamplingInferCorrectLayout*/
       return Array<Array<Layout>>{{inferred_layout, Layout::Undef()}, 
{Layout::Undef()}};
    }

Sadly this does not work and i dont yield any layout_transform near my 
Resampler OP. If i understand correctly that has to do with the fact, that a 
Layout::Undef() tells TVM to overall not insert any layout_transform.
Do you have any idea how i can achieve the "passthrough" of the 2nd Input 
tensor and outputtensor with regards to layout_transform?





---
[Visit Topic](https://discuss.tvm.apache.org/t/infercorrectlayout/9116/1) to 
respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click 
here](https://discuss.tvm.apache.org/email/unsubscribe/6f10e8f6696cabe0b13373b0dd1aed9c243b2a2354c92f969d9815d5d6852af0).

Reply via email to