class_docstr: A piecewise stationary environment dynamics.
  
  This is a piecewise stationary environment which computes rewards as:
  
  rewards(t) = observation(t) * observation_to_reward(i) + additive_reward(i)
  
  where t is the environment time (env_time) and i is the index of each piece.
  The environment time is incremented after the reward is computed while the
  piece index is incremented at the end of the time interval. The parameters
  observation_to_reward(i), additive_reward(i), and the length of interval, are
  drawn from given distributions at the beginning of each temporal interval.
class_docstr_tok: ["A","piecewise","stationary","environment","dynamics",".","This","is","a","piecewise","stationary","environment","which","computes","rewards","as",":","rewards","(","t",")","=","observation","(","t",")","*","observation_to_reward","(","i",")","+","additive_reward","(","i",")","where","t","is","the","environment","time","(","env_time",")","and","i","is","the","index","of","each","piece",".","The","environment","time","is","incremented","after","the","reward","is","computed","while","the","piece","index","is","incremented","at","the","end","of","the","time","interval",".","The","parameters","observation_to_reward","(","i",")",",","additive_reward","(","i",")",",","and","the","length","of","interval",",","are","drawn","from","given","distributions","at","the","beginning","of","each","temporal","interval","."]
code: def observation(self, unused_t) -> types.NestedTensor:
      return self._observation_distribution.sample()
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import gin
  import tensorflow
  from tf_agents.bandits.environments import non_stationary_stochastic_environment
  from tf_agents.specs import tensor_spec
  from tf_agents.typing import types
label_desc: Use image node_id 5 for calling the PiecewiseStationaryDynamics obj's underlying member method code with example usage: obj.observation(unused_t) and returns: self