Skip to content

Commit 9013415

Browse files
(WIP) Use -1 for dynamic dimensions
1 parent d47398a commit 9013415

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

mcbackend/core.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ def is_rigid(nshape: Optional[Shape]):
3232
This "nullable shape" is interpreted as follows:
3333
- ``[]`` indicates scalar shape (rigid: True).
3434
- ``[2, 3]`` indicates a matrix with 2 rows and 3 columns (rigid: True).
35-
- ``[2, 0]`` indicates a matrix with 2 rows and dynamic number of columns (rigid: False).
35+
- ``[2, -1]`` indicates a matrix with 2 rows and dynamic number of columns (rigid: False).
3636
- ``None`` indicates dynamic dimensionality (rigid: False).
3737
"""
3838
if nshape is None:
3939
return False
40-
if any(s == 0 for s in nshape):
40+
if any(s == -1 for s in nshape):
4141
return False
4242
return True
4343

mcbackend/meta.py

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

protobufs/meta.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ message Variable {
2525
// The default value, an empty sequence, corresponds to scalar shape.
2626
// Note that for variables of dynamic dimensionality, ``undefined_ndim=True``
2727
// can be set to render ``shape`` and ``dims`` meaningless.
28-
repeated uint64 shape = 3;
28+
repeated int64 shape = 3;
2929
// Names of the variable's dimensions.
3030
// The default value, an empty sequence, corresponds to undefined dimension names
3131
// and applies to scalar variables, and variables where ``undefined_ndim=True``.

0 commit comments

Comments
 (0)