I meant something like this:
  

      gist.github.com
  

  
    https://gist.github.com/InnovArul/7a3133925df1091aee462148204bb9c9 1

  custom_val.py
  import torch, torch.nn as nn

class LowlevelModule(nn.Module):
    def __init__(self, custom_val):
        super().__init__()
        self.custom_val = custom_val

    def print_custom_val(self):
        print(self.custom_val.item())

    This file has been truncated. show original