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
nni
Commits
7cb66c97
"test/git@developer.sourcefind.cn:change/sglang.git" did not exist on "c9064e6fd9a5356ee579e9d452bfad725f8e6f2c"
Unverified
Commit
7cb66c97
authored
Nov 03, 2022
by
J-shang
Committed by
GitHub
Nov 03, 2022
Browse files
[Compression] fix speedup randomize bool (#5191)
parent
57fde460
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
1 deletion
+3
-1
nni/algorithms/compression/v2/pytorch/pruning/basic_pruner.py
...algorithms/compression/v2/pytorch/pruning/basic_pruner.py
+1
-1
nni/compression/pytorch/utils/utils.py
nni/compression/pytorch/utils/utils.py
+2
-0
No files found.
nni/algorithms/compression/v2/pytorch/pruning/basic_pruner.py
View file @
7cb66c97
...
...
@@ -952,7 +952,7 @@ class TaylorFOWeightPruner(EvaluatorBasedPruner):
The old API (``trainer``, ``traced_optimizer`` and ``criterion``) is still supported and will be deprecated in v3.0.
If you want to consult the old API, please refer to `v2.8 pruner API <https://nni.readthedocs.io/en/v2.8/reference/compression/pruner.html>`__.
training_steps
The step number used to collect
activation
s.
The step number used to collect
gradient
s.
mode
'normal', 'dependency_aware' or 'global'.
...
...
nni/compression/pytorch/utils/utils.py
View file @
7cb66c97
...
...
@@ -69,6 +69,8 @@ def randomize_tensor(tensor, start=1, end=100):
assert
isinstance
(
tensor
,
torch
.
Tensor
)
if
tensor
.
dtype
in
torch_integer_dtype
:
# integer tensor can only be randomized by the torch.randint
if
tensor
.
dtype
is
torch
.
bool
:
start
,
end
=
0
,
2
torch
.
randint
(
int
(
start
),
int
(
end
),
tensor
.
size
(),
out
=
tensor
.
data
,
dtype
=
tensor
.
dtype
)
# pass
...
...
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