forked from stdlib-js/stdlib
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrepl.txt
More file actions
66 lines (50 loc) · 1.69 KB
/
repl.txt
File metadata and controls
66 lines (50 loc) · 1.69 KB
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
55
56
57
58
59
60
61
62
63
64
65
{{alias}}( x[, options] )
Computes the absolute value for each element in an ndarray.
The function returns an ndarray having the same shape as the input ndarray.
Parameters
----------
x: ndarray
Input array. Must have a numeric or "generic" data type.
options: Object (optional)
Options.
options.dtype: string|DataType (optional)
Output array data type. Must be a real-valued or "generic" data type.
options.order: string (optional)
Output array order. Must be either row-major (C-style) or column-major
(Fortran-style). By default, the order of the output array is the same
as the input array.
Returns
-------
y: ndarray
Output array containing element-wise results.
Examples
--------
> var arr = [ [ -1.0, -2.0 ], [ -3.0, -4.0 ] ];
> var x = {{alias:@stdlib/ndarray/array}}( arr );
> var y = {{alias}}( x )
<ndarray>[ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ]
{{alias}}.assign( x, y )
Computes the absolute value for each element in an ndarray and assigns
results to a provided output ndarray.
Parameters
----------
x: ndarray
Input array. Must have a numeric or "generic" data type.
y: ndarray
Output array.
Returns
-------
y: ndarray
Output array.
Examples
--------
> var arr = [ [ -1.0, -2.0 ], [ -3.0, -4.0 ] ];
> var x = {{alias:@stdlib/ndarray/array}}( arr );
> var sh = {{alias:@stdlib/ndarray/shape}}( x );
> var y = {{alias:@stdlib/ndarray/zeros}}( sh );
> var out = {{alias}}.assign( x, y )
<ndarray>[ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ]
> var bool = ( out === y )
true
See Also
--------