forked from Theano/Theano
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make CudaNdarray_sger work with neg strides.
- Loading branch information
Showing
1 changed file
with
17 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6174405
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting - did this actually come up in usage? How are negative strides handled on CPU?
Anyway, this brings to mind a special case that if both x.stride < 0 and A.stride[0] < 0 then no copy is needed because you can do the whole dot-product backward. Same thing for y.stride and A.stride[1]. This same thinking goes for the CPU implementation as well. But it's a tricky thing to write and test (would take an hour or two at least) so how about adding this text as a comment, or making a ticket for it. Someone trying to optimize his backward GER / GEMM may some day implement it.
6174405
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This happened in already existing tests for outer on the gpu. It was testing it like this
outer(a[::-1], b)
outer(a, b[::-1])
I don't know what is done on the cpu. I made a ticket for 0.5.1 release.