Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Nordic Language Processing Laboratory
easybuild
Commits
0145501a
Commit
0145501a
authored
Sep 18, 2020
by
Sabry Razick
Browse files
Matrics test
parent
4a9aa5fa
Changes
3
Hide whitespace changes
Inline
Side-by-side
tests/tensor/matricsdot-GPU.py
0 → 100644
View file @
0145501a
#!/usr/bin/env python3
import
numpy
as
np
import
tensorflow
as
tf
limit
=
25000
import
tensorflow
as
tf
tf
.
debugging
.
set_log_device_placement
(
True
)
try
:
# Place tensors on the GPU
with
tf
.
device
(
'/GPU:0'
):
b
=
tf
.
random
.
uniform
(
shape
=
[
limit
,
limit
],
minval
=
5
,
maxval
=
10
,
dtype
=
tf
.
int32
)
a
=
tf
.
random
.
uniform
(
shape
=
[
limit
,
limit
],
minval
=
5
,
maxval
=
10
,
dtype
=
tf
.
int32
)
c
=
tf
.
matmul
(
a
,
b
)
c_np
=
c
.
numpy
()
print
(
c_np
.
shape
)
except
RuntimeError
as
e
:
print
(
e
)
tests/tensor/matricsdot.py
0 → 100644
View file @
0145501a
#!/usr/bin/env python3
import
numpy
as
np
import
tensorflow
as
tf
limit
=
50
type
=
tf
.
float16
b
=
tf
.
random
.
uniform
(
shape
=
[
limit
,
limit
],
minval
=
5
,
maxval
=
10
,
dtype
=
tf
.
float16
)
a
=
tf
.
random
.
uniform
(
shape
=
[
limit
,
limit
],
minval
=
5
,
maxval
=
10
,
dtype
=
tf
.
float16
)
c
=
tf
.
matmul
(
a
,
b
)
c_np
=
c
.
numpy
()
print
(
c_np
.
shape
)
#>>> x=tf.constant([1.0,2])
#>>> x.dtype
#tf.float32
tests/tensor/notes
0 → 100644
View file @
0145501a
#!/usr/bin/env python3
import
numpy
as
np
import
tensorflow
as
tf
limit
=
50
type
=
tf
.
float16
b
=
tf
.
random
.
uniform
(
shape
=
[
limit
,
limit
],
minval
=
5
,
maxval
=
10
,
dtype
=
tf
.
float16
)
a
=
tf
.
random
.
uniform
(
shape
=
[
limit
,
limit
],
minval
=
5
,
maxval
=
10
,
dtype
=
tf
.
float16
)
c
=
tf
.
matmul
(
a
,
b
)
b_np
=
b
.
numpy
()
#>>> x=tf.constant([1.0,2])
#>>> x.dtype
#tf.float32
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment