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
bitsandbytes
Commits
0a0b531f
"git@developer.sourcefind.cn:OpenDAS/mmcv.git" did not exist on "a0939977a3b3c34c925c565c3fd3dcbe5d09e23c"
Commit
0a0b531f
authored
Sep 13, 2023
by
Ruslan Svirschevski
Browse files
removed optional data=None in from_prequantized
parent
7a117e44
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
4 deletions
+1
-4
bitsandbytes/nn/modules.py
bitsandbytes/nn/modules.py
+1
-4
No files found.
bitsandbytes/nn/modules.py
View file @
0a0b531f
...
...
@@ -154,10 +154,7 @@ class Params4bit(torch.nn.Parameter):
return
self
@
classmethod
def
from_prequantized
(
cls
,
quantized_stats
,
data
=
None
,
requires_grad
=
False
,
device
=
'cuda'
,
**
kwargs
):
if
data
is
None
:
weight_key
=
[
k
for
k
in
quantized_stats
if
k
.
endswith
(
".weight"
)][
0
]
data
=
quantized_stats
.
pop
(
weight_key
)
def
from_prequantized
(
cls
,
data
,
quantized_stats
,
requires_grad
=
False
,
device
=
'cuda'
,
**
kwargs
):
self
=
torch
.
Tensor
.
_make_subclass
(
cls
,
data
.
to
(
device
))
self
.
requires_grad
=
requires_grad
self
.
quant_state
=
QuantState
.
from_dict
(
qs_dict
=
quantized_stats
,
device
=
device
)
...
...
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