spcl / spcl/dace

Compile-time None is not handled correctly

Open
#1,146 4 comments 0 reactions 1 assignee Claimed by @tbennun View on GitHub
Dominant language
Python
Stars
593
Forks
163
Avg merge
2d 23h
Merged PRs (30d)
60

Description

The following snippet behaves differently when decorated with `@dace.program` and when not.

The could should be legal since the `maybe_none` field is known to be `not None` at compile time.

```
import dace
import numpy as np

anarray = np.ones((3,))
anotherarray = np.ones((3,))

@dace.program
def func(new_sym):
new_sym[...] = 7.0
func=func.to_sdfg(new_sym=dace.data.Array(shape=(3,), dtype=dace.float64))

@dace.program
def testf(maybe_none=None):
if maybe_none is None:
new_sym = anotherarray
else:
new_sym = anarray
func(new_sym)
testf(maybe_none=1.0)
print(anarray)
print(anotherarray)
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.