Skip to content

Commit ab9a82a

Browse files
committed
Updating README sample code to reflect the changes to min and max
1 parent 95e6284 commit ab9a82a

File tree

1 file changed

+6
-23
lines changed

1 file changed

+6
-23
lines changed

README.md

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,11 @@ af.info()
1313
# Generate a uniform random array with a size of 5 elements
1414
a = af.randu(5, 1)
1515
16-
# Get the minimum value of a
17-
a_min = af.min(a)
18-
1916
# Print a and its minimum value
2017
af.print_array(a)
21-
af.print_array(a_min)
18+
19+
# Print min and max values of a
20+
print("Minimum, Maximum: ", af.min(a), af.max(a))
2221
```
2322

2423
## Sample outputs
@@ -38,10 +37,7 @@ ArrayFire v3.0.1 (OpenCL, 64-bit Linux, build 17db1c9)
3837
0.1794
3938
0.4198
4039
41-
42-
Min value of a
43-
[1 1 1 1]
44-
0.1794
40+
Minimum, Maximum: 0.17936542630195618 0.9517996311187744
4541
```
4642

4743
On an NVIDIA GPU:
@@ -61,14 +57,7 @@ Generate a random matrix a:
6157
0.9690
6258
0.9251
6359
64-
65-
Min value of a
66-
[1 1 1 1]
67-
0.0390
68-
69-
Max value of a
70-
[1 1 1 1]
71-
0.9690
60+
Minimum, Maximum: 0.039020489901304245 0.9689629077911377
7261
```
7362

7463
Fallback to CPU when CUDA and OpenCL are not availabe:
@@ -85,13 +74,7 @@ Generate a random matrix a:
8574
0.4587
8675
0.5328
8776
88-
89-
Min value of a
90-
[1 1 1 1]
91-
0.0000
92-
93-
Max value of a
94-
[1 1 1 1]
77+
Minimum, Maximum: 7.825903594493866e-06 0.7556053400039673
9578
```
9679

9780
The backend selection is automated currently. Choosing a particular backend will be made available in the future.

0 commit comments

Comments
 (0)