title: TypeError: 'float' object cannot be interpreted as an index in Multi GPU's
body: <p>I am unable to understand why the my jupyter notebook is showing <code>TypeError</code> for float, each time I execute it.</p>
  
  <pre><code>A = np.random.rand(1e4, 1e4).astype('float32')
  B = np.random.rand(1e4, 1e4).astype('float32')
  
  
  c1 = []
  c2 = []
  
  
  def matpow(M, n):
      if n &lt; 1:  #Abstract cases where n &lt; 1
          return M
      else:
          return tf.matmul(M, matpow(M, n-1))
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>Traceback (most recent call last) 
  &lt;ipython-input-5-61ea4b300d55&gt; in &lt;module&gt;()
        1 # Example: compute A^n + B^n on 2 GPUs
        2 #Create random Large matrix
  ----&gt; 3 A = np.random.rand(1e4, 1e4).astype('float32')
        4 B = np.random.rand(1e4, 1e4).astype('float32')
        5 
  mtrand.pyx in mtrand.RandomState.rand()
  mtrand.pyx in mtrand.RandomState.random_sample()
  mtrand.pyx in mtrand.cont0_array()
  TypeError: 'float' object cannot be interpreted as an index
  </code></pre>