Skip to content

Commit a3d2b95

Browse files
committed
ranks should be json ints
1 parent 3a787f6 commit a3d2b95

1 file changed

Lines changed: 21 additions & 14 deletions

File tree

spec/latest/index.bs

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,8 @@ The level descriptors are dictionaries defined as follows:
272272

273273
#### Element #### {#element_level}
274274

275-
If the level is an element level, it represents zero or more scalars. It implies
275+
If the level is an element level, it represents zero or more scalars.
276+
If `values_type` is not `iso`, it implies
276277
that the following binary arrays are present in the tensor:
277278

278279
: values
@@ -348,7 +349,7 @@ Vector format is equivalent to
348349
{
349350
"format": {
350351
"level": "dense",
351-
"rank": "1",
352+
"rank": 1,
352353
"subformat": {
353354
"level": "element",
354355
}
@@ -366,10 +367,10 @@ Vector format is equivalent to
366367
{
367368
"format": {
368369
"level": "dense",
369-
"rank": "1",
370+
"rank": 1,
370371
"subformat": {
371372
"level": "sparse",
372-
"rank": "1",
373+
"rank": 1,
373374
"subformat": {
374375
"level": "element",
375376
}
@@ -385,10 +386,10 @@ Vector format is equivalent to
385386
"swizzle": [1, 0],
386387
"format": {
387388
"level": "dense",
388-
"rank": "1",
389+
"rank": 1,
389390
"subformat": {
390391
"level": "sparse",
391-
"rank": "1",
392+
"rank": 1,
392393
"subformat": {
393394
"level": "element",
394395
}
@@ -403,10 +404,10 @@ Vector format is equivalent to
403404
{
404405
"format": {
405406
"level": "sparse",
406-
"rank": "1",
407+
"rank": 1,
407408
"subformat": {
408409
"level": "sparse",
409-
"rank": "1",
410+
"rank": 1,
410411
"subformat": {
411412
"level": "element",
412413
}
@@ -422,10 +423,10 @@ Vector format is equivalent to
422423
"format": {
423424
"swizzle": [1, 0],
424425
"level": "sparse",
425-
"rank": "1",
426+
"rank": 1,
426427
"subformat": {
427428
"level": "sparse",
428-
"rank": "1",
429+
"rank": 1,
429430
"subformat": {
430431
"level": "element",
431432
}
@@ -440,7 +441,7 @@ Vector format is equivalent to
440441
{
441442
"format": {
442443
"level": "sparse",
443-
"rank": "2",
444+
"rank": 2,
444445
"subformat": {
445446
"level": "element",
446447
}
@@ -457,7 +458,7 @@ Column-wise Coordinate format
457458
"swizzle": [1, 0],
458459
"format": {
459460
"level": "sparse",
460-
"rank": "2",
461+
"rank": 2,
461462
"subformat": {
462463
"level": "element",
463464
}
@@ -479,6 +480,12 @@ after reading the values array into memory, it should be interpreted as boolean
479480
For a given [[#key_format]], all named binary arrays for that format shall have a
480481
corresponding name in `data_types`.
481482

483+
### Sparse Array with All Values the Same ### {#iso_arrays}
484+
485+
When all values of a sparse array are the same identical value, a special syntax is
486+
provided to compress the value array to a single value rather than duplicating the same
487+
number unnecessarily. The type is written as `iso[<type>]` to indicate that the array
488+
will store only a single element which is common to all stored indices.
482489

483490
<div class=example>
484491

@@ -543,10 +550,10 @@ Example of a CSR Matrix whose values are all 1.
543550
{
544551
"format": {
545552
"level": "dense",
546-
"rank": "1",
553+
"rank": 1,
547554
"subformat": {
548555
"level": "sparse",
549-
"rank": "1",
556+
"rank": 1,
550557
"subformat": {
551558
"level": "iso",
552559
}

0 commit comments

Comments
 (0)