Repository navigation
Conversation
'init' of 'scan' may be a runtime scalar or a field without the scan dimension, giving the initial carry per column. A non-literal init is passed to the scan as an extra argument and selected on the first level via a flag in the carry, seeded with a typed zero.
A default 0.0 only matches float64 carries and has no meaning for a runtime init. 'scan_operator' keeps its default.
Contributor
Author
|
🤖 Written by an agent on behalf of @havogt |
1 of 2 tasks
# Conflicts: # src/gt4py/next/embedded/operators.py # src/gt4py/next/ffront/foast_to_gtir.py # tests/next_tests/integration_tests/feature_tests/ffront_tests/test_scan.py
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Stacked on #3065.
initof thescanbuiltin may be a runtime value, and is now required:initmay be a literal, a scalar, or a field without the scan dimension holding the initial carry of each column. For tuple carries each element may be any of these. A field over the scan dimension is rejected, and so are fields whose dimensions are not a subset of the result's.inithas no default any more.0.0only matchedfloat64carries.@scan_operatorkeeps its default.forwardstays a compile-time constant.Changes:
forwardmust be a literal. The carry check compares against the dtype of field leaves ofinit, and a call-site check validates the dimensions of fieldinits.initseeds the scan as before. A stencil may not reference outer symbols, so a non-literalinitis passed as an extra argument to the scan'sas_fieldopand read on the first level: the carry becomes(is_initialized, state), seeded withFalseand a typed zero.ScanOperatorreadsinitper column.Requirements