code: def _get_batch_logged_actions(self, arr):
      action_counter = Counter()
      for actions in arr:
          # torch.max() returns the element and the index.
          # The latter is the argmax equivalent
          _, argmax = torch.max(actions, dim=1)
  
          # Counter object does not work well with Tensors, hence casting back to numpy
          action_counter.update(Counter(argmax.numpy()))
  
      total_actions = 1.0 * sum(action_counter.values())
  
      return (
          {
              action_name: (action_counter[i] / total_actions)
              for i, action_name in enumerate(self.action_names)
          },
          {
              action_name: action_counter[i]
              for i, action_name in enumerate(self.action_names)
          },
      )
  
file_path: ReAgent/reagent/evaluation/evaluator.py
imports: import logging
  from collections import Counter
  from typing import Dict, List, Optional
  import torch
  import torch.nn.functional
  from reagent.core.tracker import observable
  from reagent.evaluation.cpe import CpeDetails, CpeEstimateSet
  from reagent.evaluation.doubly_robust_estimator import DoublyRobustEstimator
  from reagent.evaluation.evaluation_data_page import EvaluationDataPage
  from reagent.evaluation.sequential_doubly_robust_estimator import SequentialDoublyRobustEstimator
  from reagent.evaluation.weighted_sequential_doubly_robust_estimator import WeightedSequentialDoublyRobustEstimator
label_desc: Use image node_id 4 for calling the Evaluator obj's underlying member method code with example usage: obj._get_batch_logged_actions(arr) and returns: unknown,  unknown