Hi @Apoorva_Rani,
You can do this using gluon.nn.SymbolBlock as described here:
gluon.nn.SymbolBlock
Hoping that this will help you