I want to compute the skcuda equivalent to A.T @ b for numpy arrays (A, b) when A has 2 dimensions and b has one dimension. Here's some simple test data
import numpy as np
import pycuda.gpuarray as gpuarray
import skcuda.linalg as skla
A_gpu = gpuarray.to_gpu(np.ones((3, 2)))
b_gpu = gpuarray.to_gpu(np.ones(3))
I would expect that the function call below produces the desired output. But instead it raises a ValueError:
skla.dot(A_gpu, b_gpu, transa='T')
Traceback (most recent call last):
File "/home/riley/anaconda3/envs/rla39a/lib/python3.9/site-packages/IPython/core/interactiveshell.py", line 3441, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-27-3e66e0c2b9c5>", line 1, in <module>
skla.dot(A_gpu, b_gpu, transa='T')
File "/home/riley/anaconda3/envs/rla39a/lib/python3.9/site-packages/skcuda/linalg.py", line 1060, in dot
return out.reshape(out_shape)
File "/home/riley/anaconda3/envs/rla39a/lib/python3.9/site-packages/pycuda/gpuarray.py", line 912, in reshape
raise ValueError("total size of new array must be unchanged")
ValueError: total size of new array must be unchanged
The function call below computes the expected result
Problem
I want to compute the skcuda equivalent to
A.T @ b
for numpy arrays(A, b)
when A has 2 dimensions and b has one dimension. Here's some simple test dataI would expect that the function call below produces the desired output. But instead it raises a ValueError:
The function call below computes the expected result
Environment