Closed Oceania2018 closed 5 years ago
Uploading the sample input and output shown by @Oceania2018 on our slack conversation here.
The type of batching you want to do dot product can be done using matmul. The arrayfire function named dot product only handles the case of dot(vector_array, vector_array)
. Having said that, like I pointed at the beginning of this paragraph, batched dot product can be carried out using matrix multiplication.
When I pass int
, it raises error. If I change to float
or double
, it works in matmul
.
Matmul is supported for floating point types: float, double and their complex counterparts. Hence, error is returned by C API.
the matmul
return the result is not correct. It should be [[7, 11], [4, 7]]
The numpy result:
The arrayfire result:
What is the result of matmul from arrayfire ?
[[9, 8], [5, 5]]
The image you uploaded shows np.dot result as [[9, 8], [5, 5]]
.
In any case, irrespective of inputs using matrix multiplication is a standard way to obtain bunch of dot products quickly. Please note that ArrayFire expects data to be in column major format, may be that is the reason behind different output.
Whe I run the HelloWorld and try to do
dot
;