FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
arrayfire-python/tests/simple/data.py at master · arrayfire/arrayfire-python · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
arrayfire
/
arrayfire-python
Public
Notifications
You must be signed in to change notification settings
Fork
64
Star
422
Code
Issues
57
Pull requests
3
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
arrayfire-python
/
tests
/
simple
/
data.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
77 lines (52 loc) · 1.92 KB
Breadcrumbs
arrayfire-python
/
tests
/
simple
/
data.py
Copy path
File metadata and controls
77 lines (52 loc) · 1.92 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
66
67
68
69
70
71
72
73
74
75
76
77
#!/usr/bin/env python
#######################################################
# Copyright (c) 2015, ArrayFire
# All rights reserved.
#
# This file is distributed under 3-clause BSD license.
# The complete license agreement can be obtained at:
# http://arrayfire.com/licenses/BSD-3-Clause
########################################################
import
arrayfire
as
af
from
.
import
_util
def
simple_data
(
verbose
=
False
):
display_func
=
_util
.
display_func
(
verbose
)
display_func
(
af
.
constant
(
100
,
3
,
3
,
dtype
=
af
.
Dtype
.
f32
))
display_func
(
af
.
constant
(
25
,
3
,
3
,
dtype
=
af
.
Dtype
.
c32
))
display_func
(
af
.
constant
(
2
**
50
,
3
,
3
,
dtype
=
af
.
Dtype
.
s64
))
display_func
(
af
.
constant
(
2
+
3j
,
3
,
3
))
display_func
(
af
.
constant
(
3
+
5j
,
3
,
3
,
dtype
=
af
.
Dtype
.
c32
))
display_func
(
af
.
range
(
3
,
3
))
display_func
(
af
.
iota
(
3
,
3
,
tile_dims
=
(
2
,
2
)))
display_func
(
af
.
identity
(
3
,
3
,
1
,
2
,
af
.
Dtype
.
b8
))
display_func
(
af
.
identity
(
3
,
3
,
dtype
=
af
.
Dtype
.
c32
))
a
=
af
.
randu
(
3
,
4
)
b
=
af
.
diag
(
a
,
extract
=
True
)
c
=
af
.
diag
(
a
,
1
,
extract
=
True
)
display_func
(
a
)
display_func
(
b
)
display_func
(
c
)
display_func
(
af
.
diag
(
b
,
extract
=
False
))
display_func
(
af
.
diag
(
c
,
1
,
extract
=
False
))
display_func
(
af
.
join
(
0
,
a
,
a
))
display_func
(
af
.
join
(
1
,
a
,
a
,
a
))
display_func
(
af
.
tile
(
a
,
2
,
2
))
display_func
(
af
.
reorder
(
a
,
1
,
0
))
display_func
(
af
.
shift
(
a
,
-
1
,
1
))
display_func
(
af
.
moddims
(
a
,
6
,
2
))
display_func
(
af
.
flat
(
a
))
display_func
(
af
.
flip
(
a
,
0
))
display_func
(
af
.
flip
(
a
,
1
))
display_func
(
af
.
lower
(
a
,
False
))
display_func
(
af
.
lower
(
a
,
True
))
display_func
(
af
.
upper
(
a
,
False
))
display_func
(
af
.
upper
(
a
,
True
))
a
=
af
.
randu
(
5
,
5
)
display_func
(
af
.
transpose
(
a
))
af
.
transpose_inplace
(
a
)
display_func
(
a
)
display_func
(
af
.
select
(
a
>
0.3
,
a
,
-
0.3
))
af
.
replace
(
a
,
a
>
0.3
,
-
0.3
)
display_func
(
a
)
display_func
(
af
.
pad
(
a
, (
1
,
1
,
0
,
0
), (
2
,
2
,
0
,
0
)))
_util
.
tests
[
"data"
]
=
simple_data
Back
|
FazBrowse Home
|
New Git URL