Cannot test rule for structure where one (non-differentiable) field cannot be vectorized
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- julia
- Área
- testing-qa
Línea de trabajo
Comienza en la ruta de diferencias finitas que llama a to_vec al probar una rrule y sigue cómo se maneja un Tangent{Struct} proporcionado con x=NoTangent() y una tangente para y. Reproduce el problema con el ejemplo de Struct y verifica que probar el componente y ya no requiera vectorizar el campo x ignorado.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
I am writing an rrule for *(::Struct, arr) where the structure and function look like,
struct Struct where {T<:Real}
x # stuff that can't be differentiated
y::T
end
*(s::Struct, arr) = y * x(arr)
However, I am unable to test my rrule, even with a manually provided tangent for an instance of Struct that looks like Tangent{Struct}(;x=NoTangent(), y=one(T)).
The reason seems to be that finite differences tries to to_vec the instance of struct. Given that the struct is not completely ignored, only the field x, it ends up trying to to_vec the field x as well. But this field is a reference to a rather crazy mutable structure with circular references, and so I end up with an error, and am unable to test that the rrule is correct w.r.t. y.
(To make it more concrete, the structure in question is a ScaledPlan from AbstractFFTs and the field x refers to a primitive FFT plan from FFTW, which is mutable because of its pinv cache.)
Ideally, it shouldn't matter what value is in the field x, since it is marked as NoTangent in the user-provided tangent? Just as how the entire input gets ignored if it is marked as NoTangent.
- Lenguaje dominante
- Julia
- Estrellas
- 50
- Forks
- 18
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de JuliaDiff/ChainRulesTestUtils.jl
-
code snippet in readmeAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
JuliaDiff/ChainRulesTestUtils.jl#148 · 1 reacción ·
-
use DocThemeIndigoAbiertodocumentation good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
-
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
-
more `test_approx` ambiguitiesAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 45/100
-
mutation
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
Todos los issues de JuliaDiff/ChainRulesTestUtils.jl
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
oscar-system/GAP.jl#1455 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
JuliaAI/MLJTransforms.jl#85 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
SciML/OrdinaryDiffEq.jl#4875 ·
Los mantenedores suelen responder en 3 días
-
documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
SciML/NonlinearSolve.jl#1372 ·
Los mantenedores suelen responder en 1 día