All `make_partials_propagator` to return its input args as a tuple
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 35/100
Piste de recherche
Start at the make_partials_propagator entry point and inspect the distributions' ref_type_t boilerplate. Trace how autodiff and non-autodiff arguments are handled, then define the tuple-returning behavior so local references reuse the moved memory. Done means the affected distributions use this interface without unnecessary copies.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
When a user calls something like normal_lpdf(std::move(y), std::move(mu), std::move(sigma)) nothing really happens with the moved memory. But we could actually move those objects into the partials_propagator so that the partials_propagator does not have to make a hard copy of the inputs. A nice piece would be if make_partials_propagator returned a tuple of the partials propagator and references to the moved memory so that the functions would reuse that local memory.
auto [partials_prop, y_ref, mu_ref, sigma_ref] = make_partials_propagator(
std::move(y), std::move(mu), std::move(sigma));
For autodiff types the inputs would be moved into the partials propagator and then references to the object would be the return. For non-autodiff types the object would just be passed back
This would replace a lot of the ref_type_t boilerplate inside of the distributions since the values would then sit inside of the partials propagator.
This would be useful inside of the stanc compiler. We could have an optimization pass which looks at the last use of each vector/array in the log_prob function and applies std::move to the object at that point.
- Langage dominant
- C++
- Étoiles
- 845
- Forks
- 225
- Merge moyen
- 4 j 21 h
- PR mergées (30 j)
- 13
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de stan-dev/math
-
Difficulté 3/5 1-2 jours Accessibilité débutants 54/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 4/5 3-5 jours Accessibilité débutants 54/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 35/100
Les mainteneurs répondent en général sous 1 jour
-
numerics performance
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 35/100
stan-dev/math#3481 · 1 réaction ·
Les mainteneurs répondent en général sous 1 jour
-
`eigendecompose_sym`, `eigenvalues_sym` and `eigenvectors_sym` do not compile for complex matrices of `fvar<var>` or `fvar<fvar<double>>`Peut-être à nouveau libre Une pull request pour cette issue a été fermée sans être fusionnée. Ouvertebug
Difficulté 3/5 1-2 jours Accessibilité débutants 55/100
stan-dev/math#3477 · 5 commentaires ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de stan-dev/math
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
Les mainteneurs répondent en général sous 1 jour
-
bug test
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
OpenAssetIO/OpenAssetIO#1527 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 66/100
ROCm/rocm-systems#15475 ·
Les mainteneurs répondent en général sous 2 jours
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 68/100
Sendspin/sendspin-cpp#257 ·
Les mainteneurs répondent en général sous 1 jour
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
pocoproject/poco#5664 ·
Les mainteneurs répondent en général sous 2 jours