cudarray
cudarray copied to clipboard
Update math.py to include tanh elementwise op
This was my first pull request ever, so hope I did it right :) . I added a tanh elementwise function. It seemed to be missing and intended to be included as there is a tanh_d.
Hey, thank you for the proposal! I have intentionally left out cudarray.nnet.tanh() because NumPy exposes it at the root level. Therefore, you can find it as cudarray.tanh(). The implementation is here.
Best, Anders
Ah great, Thanks Anders.
While on the subject, are elementwise operations executed on the CPU or GPU. I did some monitoring and it seems like elementwise operations are performed on the CPU.
Henry,
Hey, I have just pushed a commit. In this new version of CUDArray you can check the backend by printing cudarray._backend. If this variable is 'numpy' instead of 'cuda', something is wrong with your libcudarray installation.