Skip to content

Support simple loops #3

@dfdx

Description

@dfdx

Although preferred way to express iteration is through aggregation functions, we may still encounter loops in 3rd party code and it would be nice to support at least simple ones. One particular example is:

y = 0.0
for x in xs
    y += f(x)
end

We have 2 options here:

  1. Preprocess loops transforming them into aggregation functions. E.g. loop above may be transformed into sum(f.(x)).
  2. Translate a derivative of a loop into a loop of derivatives. This is more general-purpose, but looks also much harder to implement.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions