1#ifndef HALIDE_DERIVATIVE_H
2#define HALIDE_DERIVATIVE_H
24 using FuncKey = std::pair<std::string, int>;
26 explicit Derivative(
const std::map<FuncKey, Func> &adjoints_in)
27 : adjoints(adjoints_in) {
29 explicit Derivative(std::map<FuncKey, Func> &&adjoints_in)
30 : adjoints(std::move(adjoints_in)) {
41 const std::map<FuncKey, Func> adjoints;
54 const Region &output_bounds);
Base classes for Halide expressions (Halide::Expr) and statements (Halide::Internal::Stmt)
Defines Func - the front-end handle on a halide function, and related classes.
Helper structure storing the adjoints Func.
Func operator()(const std::string &name) const
Derivative(std::map< FuncKey, Func > &&adjoints_in)
std::pair< std::string, int > FuncKey
Func operator()(const Func &func, int update_id=-1) const
Func operator()(const Buffer<> &buffer) const
Func operator()(const Param<> ¶m) const
Derivative(const std::map< FuncKey, Func > &adjoints_in)
A scalar parameter to a halide pipeline.
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
Derivative propagate_adjoints(const Func &output, const Func &adjoint, const Region &output_bounds)
Given a Func and a corresponding adjoint, (back)propagate the adjoint to all dependent Funcs,...
std::vector< Range > Region
A multi-dimensional box.