Thanks @ptrblck .  I was working with graphs and after trying to run on cpu ,i found that there was a mismatch between number of nodes (N) and shape of adjacency matrix which in ideal case should be N x N .