How to convert non nn.module based code into nn.module based code in pytorch?

hi @ptrblck
i am trying to use this one : TextFuseNet/ at master · ying09/TextFuseNet · GitHub

into this one : detectron2/ at master · facebookresearch/detectron2 · GitHub

you can see the latest version of detectron2 is written with lot of nn.module based code

the init function in my first link attached above is different than the 2nd link’s function,i am not understanding how do i pass cfg there?
i tried code conversion like this : det -
but i get this error :", line 593, in init
self.mutil_path_fuse_on = cfg.MODEL.TEXTFUSENET_MUTIL_PATH_FUSE_ON
NameError: name ‘cfg’ is not defined