code: def gather_static_shared_stats(
      self,
      evaluation_dataset_as_transitions: List[Transition],
      batch_size: int,
      reward_model: Architecture,
      network_keys: List,
  ) -> None:
      all_reward_model_rewards = []
      all_old_policy_probs = []
      all_rewards = []
      all_actions = []
  
      for i in range(
          math.ceil(len(evaluation_dataset_as_transitions) / batch_size)
      ):
          batch = evaluation_dataset_as_transitions[
              i * batch_size : (i + 1) * batch_size
          ]
          batch_for_inference = Batch(batch)
  
          all_reward_model_rewards.append(
              reward_model.predict(
                  batch_for_inference.states(network_keys)
              )
          )
          all_rewards.append(batch_for_inference.rewards())
          all_actions.append(batch_for_inference.actions())
          all_old_policy_probs.append(
              batch_for_inference.info("all_action_probabilities")[
                  range(len(batch_for_inference.actions())),
                  batch_for_inference.actions(),
              ]
          )
  
      self.all_reward_model_rewards = np.concatenate(
          all_reward_model_rewards, axis=0
      )
      self.all_old_policy_probs = np.concatenate(
          all_old_policy_probs, axis=0
      )
      self.all_rewards = np.concatenate(all_rewards, axis=0)
      self.all_actions = np.concatenate(all_actions, axis=0)
  
      # mark that static shared data was collected and ready to be used
      self.is_gathered_static_shared_data = True
  
file_path: coach/rl_coach/off_policy_evaluators/ope_manager.py
imports: import math
  from collections import namedtuple
  import numpy
  from typing import List
  from rl_coach.architectures.architecture import Architecture
  from rl_coach.core_types import Episode, Batch
  from rl_coach.off_policy_evaluators.bandits.doubly_robust import DoublyRobust
  from rl_coach.off_policy_evaluators.rl.sequential_doubly_robust import SequentialDoublyRobust
  from rl_coach.core_types import Transition
  from rl_coach.off_policy_evaluators.rl.weighted_importance_sampling import WeightedImportanceSampling
label_desc: Use image node_id 3 for calling the OpeManager obj's underlying member method code with example usage: obj.gather_static_shared_stats(evaluation_dataset_as_transitions, batch_size, reward_model, network_keys) without return types