Hi @ShoufaChen, your problem is easy, see 
[nd.array.reshape](https://mxnet.incubator.apache.org/api/python/ndarray/ndarray.html#mxnet.ndarray.NDArray.reshape)
 operation. The same exists for Symbol

```Python
class CustomNet(HybridBlock):
    def __init__(self,**kwards):
        HybridBlock.__init__(self,**kwards)

        with self.name_scope(): 
              # do something here 

    def hybrid_forward(self,F,input):
        # reshape input with product of two last dimensions
        b = F.reshape(input,shape=[0,0,-3]) 
        # now b has dimensions input.shape[0],input.shape[0],input.shape[2] * 
input.shape[3]
        return b
```
you can use this trick inside your custom layer definition. Hope this helps. 

[ Full content available at: 
https://github.com/apache/incubator-mxnet/issues/9288 ]
This message was relayed via gitbox.apache.org for [email protected]

Reply via email to