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
a37bf1bc
Unverified
Commit
a37bf1bc
authored
Mar 14, 2022
by
Jiarui Fang
Committed by
GitHub
Mar 14, 2022
Browse files
[hotfix] rm test_tensor_detector.py (#413)
parent
370f567e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
41 deletions
+0
-41
tests/test_utils/test_tensor_detector.py
tests/test_utils/test_tensor_detector.py
+0
-41
No files found.
tests/test_utils/test_tensor_detector.py
deleted
100644 → 0
View file @
370f567e
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
import
torch
import
torch.nn
as
nn
from
colossalai.utils
import
TensorDetector
class
MLP
(
nn
.
Module
):
def
__init__
(
self
):
super
().
__init__
()
self
.
mlp
=
nn
.
Sequential
(
nn
.
Linear
(
64
,
8
),
nn
.
ReLU
(),
nn
.
Linear
(
8
,
32
))
def
forward
(
self
,
x
):
return
self
.
mlp
(
x
)
def
test_tensor_detect
():
data
=
torch
.
rand
(
64
,
requires_grad
=
True
).
cuda
()
data
.
retain_grad
()
model
=
MLP
().
cuda
()
detector
=
TensorDetector
(
log
=
'test'
,
include_cpu
=
False
,
module
=
model
)
detector
.
detect
()
out
=
model
(
data
)
detector
.
detect
()
loss
=
out
.
sum
()
detector
.
detect
()
loss
.
backward
()
detector
.
detect
()
model
=
MLP
().
cuda
()
detector
.
detect
()
detector
.
close
()
torch
.
cuda
.
empty_cache
()
if
__name__
==
'__main__'
:
test_tensor_detect
()
\ No newline at end of file
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