Missed TensorFlow Dev Summit? Check out the video playlist. Watch recordings

tf_agents.bandits.policies.policy_utilities.set_bandit_policy_type

View source on GitHub

Sets the InfoFields.BANDIT_POLICY_TYPE on info to bandit_policy_type.

tf_agents.bandits.policies.policy_utilities.set_bandit_policy_type(
    info, bandit_policy_type
)

If policy info does not support InfoFields.BANDIT_POLICY_TYPE, this method returns info as-is (without any modification).

Args:

  • info: Policy info on which to set bandit policy type.
  • bandit_policy_type: Tensor containing BanditPolicyType enums or TensorSpec from create_bandit_policy_type_tensor_spec().

Returns:

Policy info with modified field (if possible).