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
Notice the diag output is all zeros. In my full use case I get the first row of A. This indicates something is going wrong to me. Note that once you wrap diag in a square root you get the right values printed. In my real use case the device side has the right answers but the prints that I was debugging were wrong.
The text was updated successfully, but these errors were encountered:
Here is a trivial reproducer:
`
#include "matx.h"
#include
#include
#include <math.h>
using namespace matx;
int main([[maybe_unused]] int argc, [[maybe_unused]] char **argv)
{
MATX_ENTER_HANDLER();
auto A = matx::make_tensor({4,4});
A.SetVals({ {0,1,2,3},{4,5,6,7},{8,9,10,11},{12,13,14,15}});
cudaDeviceSynchronize();
printf("A:\n"); print(A);
printf("diag A:\n"); print(diag(A));
printf("sqrt diag A:\n"); print(sqrt(diag(A)));
CUDA_CHECK_LAST_ERROR();
MATX_EXIT_HANDLER();
}`
output:
A: Tensor{float} Rank: 2, Sizes:[4, 4], Strides:[4,1] 000000: 0.0000e+00 1.0000e+00 2.0000e+00 3.0000e+00 000001: 4.0000e+00 5.0000e+00 6.0000e+00 7.0000e+00 000002: 8.0000e+00 9.0000e+00 1.0000e+01 1.1000e+01 000003: 1.2000e+01 1.3000e+01 1.4000e+01 1.5000e+01 diag A: Operator{float} Rank: 1, Sizes:[4] 000000: 0.0000e+00 000001: 0.0000e+00 000002: 0.0000e+00 000003: 0.0000e+00 sqrt diag A: Operator{float} Rank: 1, Sizes:[4] 000000: 0.0000e+00 000001: 2.2361e+00 000002: 3.1623e+00 000003: 3.8730e+00
Notice the diag output is all zeros. In my full use case I get the first row of A. This indicates something is going wrong to me. Note that once you wrap diag in a square root you get the right values printed. In my real use case the device side has the right answers but the prints that I was debugging were wrong.
The text was updated successfully, but these errors were encountered: