[rllib] minor bug fix to shared model, model wasnt actually shared due to new scope (#1503)

This commit is contained in:
eugenevinitsky 2018-02-02 20:37:00 -08:00 committed by Eric Liang
parent d8850eac4b
commit 369773d3e8

View file

@ -31,7 +31,8 @@ class MultiAgentFullyConnectedNetwork(Model):
reuse = tf.AUTO_REUSE if shared_model else False
outputs = []
for i in range(len(hiddens)):
with tf.variable_scope("multi{}".format(i), reuse=reuse):
scope = "multi" if shared_model else "multi{}".format(i)
with tf.variable_scope(scope, reuse=reuse):
sub_options = options.copy()
sub_options.update({"fcnet_hiddens": hiddens[i]})
# TODO(ev) make this support arbitrary networks