FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
xtensor-python/python-module/tests/test_a.py at module · tdegeus/xtensor-python · GitHub
tdegeus
xtensor-python
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
xtensor-python
/
python-module
/
tests
/
test_a.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
59 lines (38 loc) · 1.21 KB
Breadcrumbs
xtensor-python
/
python-module
/
tests
/
test_a.py
Copy path
File metadata and controls
59 lines (38 loc) · 1.21 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
import
unittest
import
xt
import
numpy
as
np
class
test_a
(
unittest
.
TestCase
):
"""
??
"""
def
test_mean
(
self
):
a
=
np
.
random
.
random
([
103
,
102
,
101
])
n
=
np
.
mean
(
a
)
x
=
xt
.
mean
(
a
)
self
.
assertTrue
(
np
.
allclose
(
n
,
x
))
def
test_average
(
self
):
a
=
np
.
random
.
random
([
103
,
102
,
101
])
w
=
np
.
random
.
random
([
103
,
102
,
101
])
n
=
np
.
average
(
a
,
weights
=
w
)
x
=
xt
.
average
(
a
,
w
)
self
.
assertTrue
(
np
.
allclose
(
n
,
x
))
def
test_average_axes
(
self
):
a
=
np
.
random
.
random
([
103
,
102
,
101
])
w
=
np
.
random
.
random
([
103
,
102
,
101
])
axis
=
int
(
np
.
random
.
randint
(
0
,
high
=
3
))
n
=
np
.
average
(
a
,
weights
=
w
,
axis
=
(
axis
,))
x
=
xt
.
average
(
a
,
w
, [
axis
])
self
.
assertTrue
(
np
.
allclose
(
n
,
x
))
def
test_flip
(
self
):
axis
=
int
(
np
.
random
.
randint
(
0
,
high
=
3
))
a
=
np
.
random
.
random
([
103
,
102
,
101
])
n
=
np
.
flip
(
a
,
axis
)
x
=
xt
.
flip
(
a
,
axis
)
self
.
assertTrue
(
np
.
allclose
(
n
,
x
))
def
test_cos
(
self
):
a
=
np
.
random
.
random
([
103
,
102
,
101
])
n
=
np
.
cos
(
a
)
x
=
xt
.
cos
(
a
)
self
.
assertTrue
(
np
.
allclose
(
n
,
x
))
if
__name__
==
"__main__"
:
unittest
.
main
()
Back
|
FazBrowse Home
|
New Git URL