class_docstr: Linear Bandit Policy to be used by LinUCB, LinTS and possibly others.
class_docstr_tok: ["Linear","Bandit","Policy","to","be","used","by","LinUCB",",","LinTS","and","possibly","others","."]
code: def _populate_policy_info_spec(
      self, observation_spec, observation_and_action_constraint_splitter
  ):
      predicted_rewards_mean = ()
      if (
          policy_utilities.InfoFields.PREDICTED_REWARDS_MEAN
          in self._emit_policy_info
      ):
          predicted_rewards_mean = tensor_spec.TensorSpec(
              [self._num_actions], dtype=self._dtype
          )
      predicted_rewards_optimistic = ()
      if (
          policy_utilities.InfoFields.PREDICTED_REWARDS_OPTIMISTIC
          in self._emit_policy_info
      ):
          predicted_rewards_optimistic = tensor_spec.TensorSpec(
              [self._num_actions], dtype=self._dtype
          )
      predicted_rewards_sampled = ()
      if (
          policy_utilities.InfoFields.PREDICTED_REWARDS_SAMPLED
          in self._emit_policy_info
      ):
          predicted_rewards_sampled = tensor_spec.TensorSpec(
              [self._num_actions], dtype=self._dtype
          )
      if self._accepts_per_arm_features:
          # The features for the chosen arm is saved to policy_info.
          chosen_arm_features_info = (
              policy_utilities.create_chosen_arm_features_info_spec(
                  observation_spec
              )
          )
          info_spec = policy_utilities.PerArmPolicyInfo(
              predicted_rewards_mean=predicted_rewards_mean,
              predicted_rewards_optimistic=predicted_rewards_optimistic,
              predicted_rewards_sampled=predicted_rewards_sampled,
              chosen_arm_features=chosen_arm_features_info,
          )
      else:
          info_spec = policy_utilities.PolicyInfo(
              predicted_rewards_mean=predicted_rewards_mean,
              predicted_rewards_optimistic=predicted_rewards_optimistic,
              predicted_rewards_sampled=predicted_rewards_sampled,
          )
      return info_spec
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import enum
  from typing import Optional, Sequence, Text, Tuple
  import tensorflow
  import tensorflow_probability
  from tf_agents.bandits.policies import constraints
  from tf_agents.bandits.policies import linalg
  from tf_agents.bandits.specs import utils
  from tf_agents.policies import tf_policy
  from tf_agents.policies import utils
  from tf_agents.specs import tensor_spec
  from tf_agents.trajectories import policy_step
  from tf_agents.typing import types
label_desc: Use image node_id 7 for calling the LinearBanditPolicy obj's underlying member method code with example usage: obj._populate_policy_info_spec(observation_spec, observation_and_action_constraint_splitter) and returns: info_spec