Torch custom model to onnx conversion

Can we convert our model whose layers are defined in seperate custom classes into onnx form for deloyment. Model is defined in the class, and init of this class is instanciating layer (object) of other classes.