You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when multiplying k-by-m (block-sparse) with m-by-n (dense), if n==1, result is vector of zeros.
I am using tf-1.12 with cuda 9.0 and 9.2 installed, I am not sure which one is used.
code:
`
from blocksparse.matmul import BlocksparseMatMul
import tensorflow as tf
import numpy as np
when multiplying k-by-m (block-sparse) with m-by-n (dense), if n==1, result is vector of zeros.
I am using tf-1.12 with cuda 9.0 and 9.2 installed, I am not sure which one is used.
code:
`
from blocksparse.matmul import BlocksparseMatMul
import tensorflow as tf
import numpy as np
hidden_size = 16
block_size = 8
minibatch_size = 1
sparsity = np.random.randint(2, size=(hidden_size//block_size,hidden_size//block_size))
bsmm = BlocksparseMatMul(sparsity, block_size=block_size, feature_axis=0)
x = tf.placeholder(tf.float32, shape=[hidden_size, None])
w = tf.placeholder(tf.float32, shape=bsmm.w_shape)
x_data = np.ones([hidden_size, minibatch_size], dtype='float32')
a,b,c = bsmm.w_shape
w_data = np.ones(bsmm.w_shape, 'float32')
y = bsmm(x, w)
sess = tf.InteractiveSession()
sess.run(tf.global_variables_initializer())
y_ = sess.run([y], feed_dict={x:x_data, w:w_data})
print(y_[0])
`
The text was updated successfully, but these errors were encountered: