-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Open
Description
I run the example:
6 - Multi GPU - Basic Operations on multi-GPU
This cell gives error
# Example: compute A^n + B^n on 2 GPUs
# Create random large matrix
A = np.random.rand(1e4, 1e4).astype('float32')
B = np.random.rand(1e4, 1e4).astype('float32')
# Creates a graph to store results
c1 = []
c2 = []
# Define matrix power
def matpow(M, n):
if n < 1: #Abstract cases where n < 1
return M
else:
return tf.matmul(M, matpow(M, n-1))---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-4-b090f05e85b9> in <module>()
2
3 # Create random large matrix
----> 4 A = np.random.rand(1e4, 1e4).astype('float32')
5 B = np.random.rand(1e4, 1e4).astype('float32')
6
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 integerMetadata
Metadata
Assignees
Labels
No labels