Access conv layer inside custom network


Dear all,

how can I access a specific layer inside a custom layer I am designing - by name? For example, my custom layer is something like

from mxnet import gluon

class customLayer(gluon.HybridBlock):
    def __init__(self,_nlayers,**kwards):
        self.nlayers = _nlayers
        with self.name_scope():
   = gluon.nn.HybridSequential()
            for i in range(self.nlayers):

    def hybrid_forward(self,F,_x):
        x =
        return x

I can get my custom network like:

myNet = customLayer(4)

I can see all variable names with


but what I get is names for individual weights and biases, e.g. [‘customlayer0_conv0_weight’,
‘customlayer0_conv0_bias’, …], while I need the whole (e.g. conv2) layer?

Thank you.


got it: