FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
arrayfire-python/tests/simple/random.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
/
random.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
41 lines (28 loc) · 1.15 KB
Breadcrumbs
arrayfire-python
/
tests
/
simple
/
random.py
Copy path
File metadata and controls
41 lines (28 loc) · 1.15 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
#!/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_random
(
verbose
=
False
):
display_func
=
_util
.
display_func
(
verbose
)
display_func
(
af
.
randu
(
3
,
3
,
1
,
2
))
display_func
(
af
.
randu
(
3
,
3
,
1
,
2
,
af
.
Dtype
.
b8
))
display_func
(
af
.
randu
(
3
,
3
,
dtype
=
af
.
Dtype
.
c32
))
display_func
(
af
.
randn
(
3
,
3
,
1
,
2
))
display_func
(
af
.
randn
(
3
,
3
,
dtype
=
af
.
Dtype
.
c32
))
af
.
set_seed
(
1024
)
assert
(
af
.
get_seed
()
==
1024
)
engine
=
af
.
Random_Engine
(
af
.
RANDOM_ENGINE
.
MERSENNE_GP11213
,
100
)
display_func
(
af
.
randu
(
3
,
3
,
1
,
2
,
engine
=
engine
))
display_func
(
af
.
randu
(
3
,
3
,
1
,
2
,
af
.
Dtype
.
s32
,
engine
=
engine
))
display_func
(
af
.
randu
(
3
,
3
,
dtype
=
af
.
Dtype
.
c32
,
engine
=
engine
))
display_func
(
af
.
randn
(
3
,
3
,
engine
=
engine
))
engine
.
set_seed
(
100
)
assert
(
engine
.
get_seed
()
==
100
)
_util
.
tests
[
"random"
]
=
simple_random
Back
|
FazBrowse Home
|
New Git URL