artyom-beilis / pytorch_dlprim

DLPrimitives/OpenCL out of tree backend for pytorch
http://blog.dlprimitives.org/
MIT License
227 stars 16 forks source link

Small bugs and improvement for self, self_c, contiguous() #64

Closed sukamenev closed 3 months ago

sukamenev commented 4 months ago

Please see my edits. I hope I understood your ideas correctly.

artyom-beilis commented 3 months ago

I added few comments. Generally if there is a modifiable or out tensor that isn't contiguous you work on copy and copy one back like there:

https://github.com/artyom-beilis/pytorch_dlprim/blob/34e94ef887de782061a644c1408c9eeb16f2c727/src/pointwise_ops.cpp#L713

sukamenev commented 3 months ago

I created new pull request with new fixes.