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
0e4e62d3
"...images/git@developer.sourcefind.cn:OpenDAS/colossalai.git" did not exist on "08f2920ea8f54aeabc65330ca9f7c97317737da6"
Unverified
Commit
0e4e62d3
authored
Jun 21, 2022
by
Frank Lee
Committed by
GitHub
Jun 21, 2022
Browse files
[tensor] added __repr__ to spec (#1147)
parent
70dd88e2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
colossalai/tensor/spec.py
colossalai/tensor/spec.py
+6
-0
No files found.
colossalai/tensor/spec.py
View file @
0e4e62d3
...
@@ -18,6 +18,9 @@ class ParallelAction(object):
...
@@ -18,6 +18,9 @@ class ParallelAction(object):
self
.
compute_pattern
=
compute_pattern
self
.
compute_pattern
=
compute_pattern
self
.
gather_out
=
gather_out
self
.
gather_out
=
gather_out
def
__repr__
(
self
):
return
f
'compute pattern:
{
self
.
compute_pattern
}
, gather out:
{
self
.
gather_out
}
'
class
TensorSpec
(
object
):
class
TensorSpec
(
object
):
"""
"""
...
@@ -72,3 +75,6 @@ class TensorSpec(object):
...
@@ -72,3 +75,6 @@ class TensorSpec(object):
def
has_compute_pattern
(
self
,
compute_pattern
:
ComputePattern
):
def
has_compute_pattern
(
self
,
compute_pattern
:
ComputePattern
):
return
self
.
parallel_action
.
compute_pattern
==
compute_pattern
return
self
.
parallel_action
.
compute_pattern
==
compute_pattern
def
__repr__
(
self
):
return
f
'parallel action:
{
self
.
parallel_action
}
, dist_spec:
{
self
.
dist_spec
}
'
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