-
-
Notifications
You must be signed in to change notification settings - Fork 804
/
Copy pathrepl.txt
55 lines (41 loc) · 1.25 KB
/
repl.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
{{alias}}( x, inShape, outShape )
Broadcasts an array to a specified shape.
The broadcasted array shares the same data as the input array. As more than
one element of a broadcasted array may refer to the same memory location,
writing to the broadcasted array may affect multiple elements. If you need
to write to the broadcasted array, copy the array before performing
operations which may mutate elements.
The function throws an error if a provided input shape is incompatible with
a provided output shape.
Parameters
----------
x: Collection
Input array.
inShape: Collection<number>
Input array shape.
outShape: Collection<number>
Output array shape.
Returns
-------
out: Object
Broadcast object.
out.ref: Collection
Reference to original input array.
out.data: ArrayLikeObject
Broadcasted array.
out.shape: Array<number>
Broadcasted array shape.
out.strides: Array<number>
Broadcasted array strides.
Examples
--------
> var out = {{alias}}( [ 1, 2, 3 ], [ 3 ], [ 2, 3 ] )
{...}
> out.shape
[ 2, 3 ]
> out.strides
[ 0, 1 ]
> out.data
[ [ 1, 2, 3 ] ]
See Also
--------