class_docstr: Normalizes the observation values with a running mean and standard deviation of
  all the observations seen so far. The normalization is performed element-wise. Additionally, when working with
  multiple workers, the statistics used for the normalization operation are accumulated over all the workers.
class_docstr_tok: ["Normalizes","the","observation","values","with","a","running","mean","and","standard","deviation","of","all","the","observations","seen","so","far",".","The","normalization","is","performed","element-wise",".","Additionally",",","when","working","with","multiple","workers",",","the","statistics","used","for","the","normalization","operation","are","accumulated","over","all","the","workers","."]
docstr: An optional function that allows the filter to get the device if it is required to use tensorflow ops
  :param device: the device to use
  :memory_backend_params: if not None, holds params for a memory backend for sharing data (e.g. Redis)
  :param mode: the arithmetic module to use {'tf' | 'numpy'}
  :return: None
docstr_tok: ["An","optional","function","that","allows","the","filter","to","get","the","device","if","it","is","required","to","use","tensorflow","ops",":","param","device",":","the","device","to","use",":","memory_backend_params",":","if","not","None",",","holds","params","for","a","memory","backend","for","sharing","data","(","e.g",".","Redis",")",":","param","mode",":","the","arithmetic","module","to","use","{","'tf","'","|","'numpy","'","}",":","return",":","None"]
code: def set_device(
      self, device, memory_backend_params=None, mode="numpy"
  ) -> None:
      """
      An optional function that allows the filter to get the device if it is required to use tensorflow ops
      :param device: the device to use
      :memory_backend_params: if not None, holds params for a memory backend for sharing data (e.g. Redis)
      :param mode: the arithmetic module to use {'tf' | 'numpy'}
      :return: None
      """
      if mode == "tf":
          from rl_coach.architectures.tensorflow_components.shared_variables import (
              TFSharedRunningStats,
          )
  
          self.running_observation_stats = TFSharedRunningStats(
              device,
              name=self.name,
              create_ops=False,
              pubsub_params=memory_backend_params,
          )
      elif mode == "numpy":
          self.running_observation_stats = NumpySharedRunningStats(
              name=self.name, pubsub_params=memory_backend_params
          )
  
file_path: coach/rl_coach/filters/observation/observation_normalization_filter.py
imports: import os
  import pickle
  from typing import List
  import numpy
  from rl_coach.core_types import ObservationType
  from rl_coach.filters.observation.observation_filter import ObservationFilter
  from rl_coach.spaces import ObservationSpace
  from rl_coach.utilities.shared_running_stats import NumpySharedRunningStats, NumpySharedRunningStats
label_desc: Use image node_id 2 for calling the ObservationNormalizationFilter obj's underlying member method code with example usage: obj.set_device(device, memory_backend_params, mode) without return types