Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
bitsandbytes
Commits
7d1c9cfe
Commit
7d1c9cfe
authored
Nov 08, 2023
by
Ruslan Svirschevski
Browse files
extra feats in constructor Params4bit
parent
f1ef74f8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
bitsandbytes/nn/modules.py
bitsandbytes/nn/modules.py
+4
-1
No files found.
bitsandbytes/nn/modules.py
View file @
7d1c9cfe
...
@@ -168,8 +168,11 @@ class Params4bit(torch.nn.Parameter):
...
@@ -168,8 +168,11 @@ class Params4bit(torch.nn.Parameter):
if
data
.
device
.
type
!=
"cuda"
:
if
data
.
device
.
type
!=
"cuda"
:
raise
ValueError
(
f
"`data.device.type` must be 'cuda', detected
{
data
.
device
.
type
}
"
)
raise
ValueError
(
f
"`data.device.type` must be 'cuda', detected
{
data
.
device
.
type
}
"
)
cls
.
requires_grad
=
requires_grad
,
cls
.
requires_grad
=
requires_grad
cls
.
quant_state
=
QuantState
.
from_dict
(
qs_dict
=
qs_dict
,
device
=
data
.
device
)
cls
.
quant_state
=
QuantState
.
from_dict
(
qs_dict
=
qs_dict
,
device
=
data
.
device
)
cls
.
blocksize
=
cls
.
quant_state
.
blocksize
cls
.
compress_statistics
=
cls
.
quant_state
.
nested
cls
.
quant_type
=
cls
.
quant_state
.
quant_type
self
=
torch
.
Tensor
.
_make_subclass
(
cls
,
data
=
data
.
to
(
data
.
device
))
self
=
torch
.
Tensor
.
_make_subclass
(
cls
,
data
=
data
.
to
(
data
.
device
))
return
self
,
state_dict
return
self
,
state_dict
...
...
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