mirror of
https://github.com/wassname/ray.git
synced 2026-07-06 05:16:30 +08:00
[rllib] support running older version tensorflow(version < 1.5.0) (#3571)
This commit is contained in:
@@ -168,7 +168,7 @@ class VTracePolicyGraph(LearningRateSchedule, TFPolicyGraph):
|
||||
mask = tf.sequence_mask(self.model.seq_lens, max_seq_len)
|
||||
mask = tf.reshape(mask, [-1])
|
||||
else:
|
||||
mask = tf.ones_like(rewards)
|
||||
mask = tf.ones_like(rewards, dtype=tf.bool)
|
||||
|
||||
# Inputs are reshaped from [B * T] => [T - 1, B] for V-trace calc.
|
||||
self.loss = VTraceLoss(
|
||||
|
||||
@@ -206,7 +206,7 @@ class PPOPolicyGraph(LearningRateSchedule, TFPolicyGraph):
|
||||
mask = tf.sequence_mask(self.model.seq_lens, max_seq_len)
|
||||
mask = tf.reshape(mask, [-1])
|
||||
else:
|
||||
mask = tf.ones_like(adv_ph)
|
||||
mask = tf.ones_like(adv_ph, dtype=tf.bool)
|
||||
|
||||
self.loss_obj = PPOLoss(
|
||||
action_space,
|
||||
|
||||
Reference in New Issue
Block a user