This repository has been archived by the owner on Nov 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Autograd fails when using take
operator repeatedly
#11599
Comments
junrushao
changed the title
Autograd fails when using repetitive
Autograd fails when using Jul 7, 2018
take
operatortake
operator repeatedly
@sandeep-krishnamurthy Could you please label this issue: Operator,Bug |
@junrushao1994 will take a look later today |
So the problem is that the req type of the indices is not null, maybe this is due to the usage, I'll take a deeper dive into your issue later. |
Hey any updates? |
5 tasks
Fix in #11983 |
Thank you @haojin2! You rock! |
Will close the issue once #11983 is merged |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Description
Here provides a strange example that a backward pass on the accumulated sum of a 2-d NDArray
sc
, may potentially cause autograd to fail, depending on the shape ofsc
.Minimum reproducible example
TL;DR. This code calculates
x = sum(sc[i, j] for each i, j)
, and then invokes a backward passx.backward()
. The error message says that it could not calculate the gradient w.r.t. some variables, but I didn't require gradient for non-differentiable variables likei
orj
.Error Message
Steps to reproduce
test.py
, and runpython2 test.py
What have you tried to solve it?
I have no idea where it comes from. That by tweaking
row_len
andcol_len
, it behaves differently seems weird to me. I only observed thatrow_len = 1
, it never failsrow_len = 2
, andcol_len < 8
, it doesn't fails; whencol_len >= 8
, it failsrow_len = 3
, andcol_len < 7
, it doesn't fails; whencol_len >= 7
, it failsrow_len = 4
, andcol_len < 7
, it doesn't fails; whencol_len >= 7
, it failsEnvironment info
Not relevant though.
Build info
Compiler: gcc
MXNet commit hash: dd954b4 (current HEAD)
Build config: default
The text was updated successfully, but these errors were encountered: