-
Notifications
You must be signed in to change notification settings - Fork 129
Speedup AdvancedSubtensor1 and AdvancedIncSubtensor1 in C backend #1346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
a80ce3c
e10863f
5fadf46
41114da
a0abe86
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -604,7 +604,7 @@ def make_node(self, pivots): | |
|
||
def perform(self, node, inputs, outputs): | ||
[pivots] = inputs | ||
p_inv = np.arange(len(pivots), dtype=pivots.dtype) | ||
p_inv = np.arange(len(pivots), dtype="int64") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We have to always be careful about single vs double precision on floats (use floatX) but not int -- why is that? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. float32 were very geared towards GPU concerns, integers are not as problematic [citation needed] |
||
|
||
for i in range(len(pivots)): | ||
p_inv[i], p_inv[pivots[i]] = p_inv[pivots[i]], p_inv[i] | ||
|
@@ -639,7 +639,7 @@ def make_node(self, A): | |
) | ||
|
||
LU = matrix(shape=A.type.shape, dtype=A.type.dtype) | ||
pivots = vector(shape=(A.type.shape[0],), dtype="int64") | ||
pivots = vector(shape=(A.type.shape[0],), dtype="int32") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Like why 64 above but 32 here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is what the scipy function returns. The reason I went with i64 above is that |
||
|
||
return Apply(self, [A], [LU, pivots]) | ||
|
||
|
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.
What a dumb mistake, I wonder which idiot wrote this code