"vscode:/vscode.git/clone" did not exist on "ac33aa7d3782887878e6e24fb4a6238356a489a6"
Unverified Commit ef84dca1 authored by SRIRAM VETURI's avatar SRIRAM VETURI Committed by GitHub
Browse files

Update learning_schedules.py

The following error doesn't occur with the above change in code.

Error: Argument must be a dense tensor: range(0, 3) - got shape [3], but wanted []

The range function on the vairable 'num_boundaries' should be a list! Please merge this request!
parent 7922c9eb
...@@ -169,7 +169,7 @@ def manual_stepping(global_step, boundaries, rates, warmup=False): ...@@ -169,7 +169,7 @@ def manual_stepping(global_step, boundaries, rates, warmup=False):
boundaries = [0] + boundaries boundaries = [0] + boundaries
num_boundaries = len(boundaries) num_boundaries = len(boundaries)
rate_index = tf.reduce_max(tf.where(tf.greater_equal(global_step, boundaries), rate_index = tf.reduce_max(tf.where(tf.greater_equal(global_step, boundaries),
range(num_boundaries), list(range(num_boundaries)),
[0] * num_boundaries)) [0] * num_boundaries))
return tf.reduce_sum(rates * tf.one_hot(rate_index, depth=num_boundaries), return tf.reduce_sum(rates * tf.one_hot(rate_index, depth=num_boundaries),
name='learning_rate') name='learning_rate')
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment