<p dir="auto">Using latest <code class="notranslate">tf-nightly-gpu-2.0-preview</code> as of today.</p>
<p dir="auto">Consider the following code:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import tensorflow as tf
resolver = tf.distribute.cluster_resolver.TPUClusterResolver()
tf.tpu.experimental.initialize_tpu_system(resolver)
tpu_strategy = tf.distribute.experimental.TPUStrategy(resolver)"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">tensorflow</span> <span class="pl-k">as</span> <span class="pl-s1">tf</span>
<span class="pl-s1">resolver</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-s1">distribute</span>.<span class="pl-s1">cluster_resolver</span>.<span class="pl-v">TPUClusterResolver</span>()
<span class="pl-s1">tf</span>.<span class="pl-s1">tpu</span>.<span class="pl-s1">experimental</span>.<span class="pl-en">initialize_tpu_system</span>(<span class="pl-s1">resolver</span>)
<span class="pl-s1">tpu_strategy</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-s1">distribute</span>.<span class="pl-s1">experimental</span>.<span class="pl-v">TPUStrategy</span>(<span class="pl-s1">resolver</span>)</pre></div>
<p dir="auto">It fails on Colab:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&lt;ipython-input-4-8454559c747f&gt; in &lt;module&gt;()
----&gt; 1 tf.distribute.cluster_resolver.TPUClusterResolver()

AttributeError: module 'tensorflow._api.v1.distribute' has no attribute 'cluster_resolver'"><pre class="notranslate"><code class="notranslate">&lt;ipython-input-4-8454559c747f&gt; in &lt;module&gt;()
----&gt; 1 tf.distribute.cluster_resolver.TPUClusterResolver()

AttributeError: module 'tensorflow._api.v1.distribute' has no attribute 'cluster_resolver'
</code></pre></div>
<p dir="auto">This code comes from the <a href="https://www.tensorflow.org/alpha/guide/distribute_strategy#tpustrategy" rel="nofollow">TF 2.0 documentation</a>.</p>
<p dir="auto">The doc on the scatter_nd does not specify the consequence of multiple updates that reference the same location.</p>
<p dir="auto">I've tested this using the following code:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="indices = tf.constant([[4], [3], [1], [1]])
updates = tf.constant([9, 10, 11, 12])
shape = tf.constant([8])
scatter = tf.scatter_nd(indices, updates, shape)
with tf.Session() as sess:
  print sess.run(scatter)"><pre class="notranslate"><span class="pl-s1">indices</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-en">constant</span>([[<span class="pl-c1">4</span>], [<span class="pl-c1">3</span>], [<span class="pl-c1">1</span>], [<span class="pl-c1">1</span>]])
<span class="pl-s1">updates</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-en">constant</span>([<span class="pl-c1">9</span>, <span class="pl-c1">10</span>, <span class="pl-c1">11</span>, <span class="pl-c1">12</span>])
<span class="pl-s1">shape</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-en">constant</span>([<span class="pl-c1">8</span>])
<span class="pl-s1">scatter</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-en">scatter_nd</span>(<span class="pl-s1">indices</span>, <span class="pl-s1">updates</span>, <span class="pl-s1">shape</span>)
<span class="pl-k">with</span> <span class="pl-s1">tf</span>.<span class="pl-v">Session</span>() <span class="pl-k">as</span> <span class="pl-s1">sess</span>:
  <span class="pl-k">print</span> <span class="pl-s1">sess</span>.<span class="pl-en">run</span>(<span class="pl-s1">scatter</span>)</pre></div>
<p dir="auto">The resulting tensor is:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="[0, 23, 0, 10, 9, 0, 0, 0]"><pre class="notranslate">[<span class="pl-c1">0</span>, <span class="pl-c1">23</span>, <span class="pl-c1">0</span>, <span class="pl-c1">10</span>, <span class="pl-c1">9</span>, <span class="pl-c1">0</span>, <span class="pl-c1">0</span>, <span class="pl-c1">0</span>]</pre></div>
<p dir="auto">So it seems the updates are added. Is this the intended usage? If so, it would be great to clarify this in the docs.</p>
<p dir="auto">Thanks!</p>