futhark
Safe HaskellNone
LanguageGHC2021

Futhark.AD.Rev.Map

Description

VJP transformation for Map and FlatMap. This is a pretty complicated case due to the possibility of free variables. The two are handled together because the return sweep of a FlatMap is itself a Map, and so requires all the same machinery.

Synopsis

Documentation

vjpMap :: VjpOps -> [Adj] -> StmAux () -> SubExp -> Lambda SOACS -> [VName] -> ADM () Source #

Perform VJP on a Map. The Adj list is the adjoints of the result of the map.

vjpFlatMap :: VjpOps -> Pat Type -> [Adj] -> StmAux () -> SubExp -> ExtLambda SOACS -> [VName] -> ADM () Source #

Perform VJP on a FlatMap. The Adj list is the adjoints of the results of the FlatMap, including the metadata results. See Note [Adjoints of FlatMap].