code: def after_init(policy, observation_space, action_space, config):
      state_dict = policy.model.state_dict()
      policy.param_shapes = {
          k: tuple(state_dict[k].size())
          for k in sorted(state_dict.keys())
      }
      policy.num_params = sum(
          np.prod(s) for s in policy.param_shapes.values()
      )
  
file_path: ray/rllib_contrib/es/src/rllib_es/es/es_torch_policy.py
imports: import gymnasium
  import numpy
  import tree
  import ray
  from ray.rllib.models import ModelCatalog
  from ray.rllib.policy.policy_template import build_policy_class
  from ray.rllib.policy.sample_batch import SampleBatch
  from ray.rllib.utils.filter import get_filter
  from ray.rllib.utils.framework import try_import_torch
  from ray.rllib.utils.spaces.space_utils import get_base_struct_from_space, unbatch
  from ray.rllib.utils.torch_utils import convert_to_torch_tensor
label_desc: Use image node_id 2 for calling a global function with example usage: after_init(policy, observation_space, action_space, config) without return types