code: def torch_net_info(net, save_path=None):
      info_str = (
          "Total Param Number: {}\n".format(torch_total_param_num(net))
          + "Params:\n"
      )
      for k, v in net.named_parameters():
          info_str += "\t{}: {}, {}\n".format(
              k, v.shape, np.prod(v.shape)
          )
      info_str += str(net)
      if save_path is not None:
          with open(save_path, "w") as f:
              f.write(info_str)
      return info_str
  
imports: import torch.nn
  import torch.optim
  import numpy
label_desc: Use image node_id 4 for calling a global function with example usage: torch_net_info(net, save_path) and returns: info_str