time-to-botec

Benchmark sampling in different programming languages
Log | Files | Refs | README

repl.txt (799B)


      1 
      2 {{alias}}( shapes )
      3     Broadcasts array shapes to a single shape.
      4 
      5     Two respective dimensions in two shape arrays are compatible if
      6 
      7     1. the dimensions are equal.
      8     2. one dimension is `1`.
      9 
     10     The function returns `null` if provided incompatible shapes (i.e., shapes
     11     which cannot be broadcast with one another).
     12 
     13     Parameters
     14     ----------
     15     shapes: Array
     16         Array of shape arrays.
     17 
     18     Returns
     19     -------
     20     out: Array|null
     21         Broadcast shape.
     22 
     23     Examples
     24     --------
     25     // Compatible shapes:
     26     > var sh1 = [ 8, 1, 6, 1 ];
     27     > var sh2 = [ 7, 1, 5 ];
     28     > var sh = {{alias}}( [ sh1, sh2 ] )
     29     [ 8, 7, 6, 5 ]
     30 
     31     // Incompatible shapes:
     32     > sh1 = [ 3, 2 ];
     33     > sh1 = [ 2, 3 ];
     34     > sh = {{alias}}( [ sh1, sh2 ] )
     35     null
     36 
     37     See Also
     38     --------
     39