SciSharp/Numpy.NET

How to do np.stack() in c#

ANANTHAKRISHNAN1996 opened this issue · 2 comments

I have a python code for deep learning where model expects 4d array for prediction.
I have successfully computed the features and current NDarray shape in c# is {(19,513,129,1)}
Next i need to execute following line from python to c#.
X_feat = np.squeeze(np.stack((X_feat,) * 3, -1)) # where X_feat have same shape as said above.
The resultant shape is (19,513,129,3)
How can i convert above python code to c# .
Thanks

henon commented

you found a workaround? I will add any missing functions if needed.

No. Thankyou. Things are working good. I was new to numpy.
This is the equivalent i made for above python line
NDarray[] stackin = new Numpy.NDarray[3];
stackin[0] = predFeatures; // predFeatures is feature extracted. shape={(19,513,129,1)}
stackin[1] = predFeatures;
stackin[2] = predFeatures;
NDarray feat = np.squeeze(np.stack((stackin),-1));