title: CuPy and Dirichlet gives me TypeError: unsupported operand type(s) for +=: 'int' and 'tuple'
body: <p>I simply want to create a random matrix A whose vectors are drawn from the Dirichlet distribution. The function works fine with <a href="https://numpy.org/doc/stable/reference/random/generated/numpy.random.dirichlet.html" rel="nofollow noreferrer">numpy</a>:</p>
  <pre><code>import numpy as np
  A = np.random.dirichlet(np.ones(n), n)
  </code></pre>
  <p>When I do the same thing with <a href="https://docs.cupy.dev/en/stable/reference/generated/cupy.random.dirichlet.html" rel="nofollow noreferrer">cupy</a></p>
  <pre><code>import cupy as cp
  A = cp.random.dirichlet(cp.ones(n), n)
  </code></pre>
  <p>I get the error below:</p>
  <pre><code>---------------------------------------------------------------------------
  TypeError                                 Traceback (most recent call last)
  &lt;ipython-input-1-45a4f64a8b6e&gt; in &lt;module&gt;
        6 n = 10000 #Size of the square matrix
        7 
  ----&gt; 8 A = cp.random.dirichlet(cp.ones(n), n)
        9 
       10 print(&quot;--- %s seconds ---&quot; % (time.time() - start_time))
  
  ~\anaconda3\envs\tensorflow\lib\site-packages\cupy\random\_distributions.py in dirichlet(alpha, size, dtype)
      112     &quot;&quot;&quot;
      113     rs = _generator.get_random_state()
  --&gt; 114     return rs.dirichlet(alpha, size, dtype)
      115 
      116 
  
  ~\anaconda3\envs\tensorflow\lib\site-packages\cupy\random\_generator.py in dirichlet(self, alpha, size, dtype)
      144             size = alpha.shape
      145         else:
  --&gt; 146             size += alpha.shape
      147         y = cupy.empty(shape=size, dtype=dtype)
      148         _kernels.standard_gamma_kernel(alpha, self._rk_seed, y)
  
  TypeError: unsupported operand type(s) for +=: 'int' and 'tuple'
  </code></pre>
  <p>When the input is a numpy array like this</p>
  <pre><code>import cupy as cp
  import numpy as np
  
  A = cp.random.dirichlet(np.ones(n), n)
  </code></pre>
  <p>then I get the same error.</p>
  <p>The <code>alpha.shape</code> from line 146 is (n,) when I check manually. Is it a cupy bug or am I missing something?</p>
  <p>I'm using cupy-cuda101 version 8.5.0 for CUDA 10.1. Everything else that has to do with cupy and tensorflow works perfectly on my GPU (2080ti).</p>