title: tf.distribute.Strategy: TypeError: Failed to convert object of type <class 'tensorflow.python.distribute.values.PerReplica'> to Tensor
body: <p>Judging on the examples on the TensorFlow website: <a href="https://github.com/tensorflow/docs/blob/r1.15/site/en/guide/distribute_strategy.ipynb" rel="nofollow noreferrer">https://github.com/tensorflow/docs/blob/r1.15/site/en/guide/distribute_strategy.ipynb</a>, it seems there are no resources on how to adapt your code to using distribute strategy. My original code includes manipulating Tensors, for example <code>tf.expand_dims(x, axis=1)</code>. However, when distribute strategy is used, I got the abovementioned error as <code>expand_dims()</code> is not able to work on <code>PerReplica</code> object. More details of the error below: </p>
  
  <blockquote>
    <p>Contents: PerReplica:{
      0 /replica:0/task:0/device:GPU:0: Tensor("IteratorGetNext:0", shape=(?, 2, 3), dtype=float32, device=/replica:0/task:0/device:GPU:0),
      1 /replica:0/task:0/device:GPU:1: Tensor("IteratorGetNext_1:0", shape=(?, 2, 3), dtype=float32, device=/replica:0/task:0/device:GPU:1)
    }</p>
  </blockquote>
  
  <p>Anyone has any idea to any solution to this?</p>