Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ColossalAI
Commits
754aa7c8
Commit
754aa7c8
authored
Oct 18, 2022
by
Xue Fuzhao
Committed by
Frank Lee
Oct 19, 2022
Browse files
[NFC] polish tests/test_layers/test_3d/checks_3d/check_layer_3d.py code style (#1731)
parent
ff373a11
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
tests/test_layers/test_3d/checks_3d/check_layer_3d.py
tests/test_layers/test_3d/checks_3d/check_layer_3d.py
+2
-2
No files found.
tests/test_layers/test_3d/checks_3d/check_layer_3d.py
View file @
754aa7c8
...
@@ -784,7 +784,7 @@ def check_loss():
...
@@ -784,7 +784,7 @@ def check_loss():
out_shape
=
(
BATCH_SIZE
,
NUM_CLASSES
)
out_shape
=
(
BATCH_SIZE
,
NUM_CLASSES
)
out_master
=
torch
.
randn
(
out_shape
,
dtype
=
dtype
,
device
=
device
)
out_master
=
torch
.
randn
(
out_shape
,
dtype
=
dtype
,
device
=
device
)
target_master
=
torch
.
randint
(
NUM_CLASSES
,
(
BATCH_SIZE
,
),
dtype
=
torch
.
long
,
device
=
device
)
target_master
=
torch
.
randint
(
NUM_CLASSES
,
(
BATCH_SIZE
,),
dtype
=
torch
.
long
,
device
=
device
)
torch
.
distributed
.
broadcast
(
out_master
,
src
=
0
)
torch
.
distributed
.
broadcast
(
out_master
,
src
=
0
)
torch
.
distributed
.
broadcast
(
target_master
,
src
=
0
)
torch
.
distributed
.
broadcast
(
target_master
,
src
=
0
)
out
=
torch
.
chunk
(
out_master
,
DEPTH
,
dim
=
0
)[
i
]
out
=
torch
.
chunk
(
out_master
,
DEPTH
,
dim
=
0
)[
i
]
...
@@ -837,7 +837,7 @@ def check_vocab_parallel_loss():
...
@@ -837,7 +837,7 @@ def check_vocab_parallel_loss():
out_shape
=
(
BATCH_SIZE
,
NUM_CLASSES
)
out_shape
=
(
BATCH_SIZE
,
NUM_CLASSES
)
out_master
=
torch
.
randn
(
out_shape
,
dtype
=
dtype
,
device
=
device
)
out_master
=
torch
.
randn
(
out_shape
,
dtype
=
dtype
,
device
=
device
)
target_master
=
torch
.
randint
(
NUM_CLASSES
,
(
BATCH_SIZE
,
),
dtype
=
torch
.
long
,
device
=
device
)
target_master
=
torch
.
randint
(
NUM_CLASSES
,
(
BATCH_SIZE
,),
dtype
=
torch
.
long
,
device
=
device
)
torch
.
distributed
.
broadcast
(
out_master
,
src
=
0
)
torch
.
distributed
.
broadcast
(
out_master
,
src
=
0
)
torch
.
distributed
.
broadcast
(
target_master
,
src
=
0
)
torch
.
distributed
.
broadcast
(
target_master
,
src
=
0
)
out
=
torch
.
chunk
(
out_master
,
DEPTH
,
dim
=
0
)[
i
]
out
=
torch
.
chunk
(
out_master
,
DEPTH
,
dim
=
0
)[
i
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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