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
8edb777c
Commit
8edb777c
authored
Sep 08, 2022
by
shenggan
Committed by
Frank Lee
Sep 08, 2022
Browse files
[NFC] polish colossalai/nn/loss/loss_2p5d.py code style (#1553)
parent
bd2d7898
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
colossalai/nn/loss/loss_2p5d.py
colossalai/nn/loss/loss_2p5d.py
+2
-0
No files found.
colossalai/nn/loss/loss_2p5d.py
View file @
8edb777c
...
...
@@ -30,6 +30,7 @@ class CrossEntropyLoss2p5D(_Loss):
More details about ``args``, ``kwargs`` and ``torch.nn.functional.cross_entropy`` could be found in
`Cross_entropy <https://pytorch.org/docs/stable/generated/torch.nn.functional.cross_entropy.html#torch.nn.functional.cross_entropy>`_.
"""
def
__init__
(
self
,
reduction
=
True
,
*
args
,
**
kwargs
):
super
().
__init__
()
assert_tesseract_initialization
()
...
...
@@ -127,6 +128,7 @@ class VocabParallelCrossEntropyLoss2p5D(_Loss):
Args:
reduction (bool, optional): whether to average the loss, defaults to True.
"""
def
__init__
(
self
,
reduction
=
True
):
super
().
__init__
()
self
.
reduction_mean
=
reduction
...
...
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