Skip to content

Commit

Permalink
fix type promotion issue in tensorspec
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 664858958
Change-Id: Ia57049212d622770c617342b17ead8c542a650f4
  • Loading branch information
TF-Agents Team authored and copybara-github committed Aug 19, 2024
1 parent 3744cbc commit 8662dab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tf_agents/specs/tensor_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ def _unique_vals(vals):
# behavior.
# However +1 will cause overflow, in such cases we use the original maxval.
if sampling_dtype.is_integer and maxval < sampling_dtype.max:
maxval = maxval + 1
maxval = int(maxval) + 1

shape = tf.convert_to_tensor(spec.shape, dtype=tf.int32)
full_shape = tf.concat((outer_dims, shape), axis=0)
Expand Down

0 comments on commit 8662dab

Please sign in to comment.