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
0ecb8fb4
Commit
0ecb8fb4
authored
Aug 04, 2025
by
ved1beta
Browse files
lint
parent
2938c739
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
bitsandbytes/nn/modules.py
bitsandbytes/nn/modules.py
+5
-5
No files found.
bitsandbytes/nn/modules.py
View file @
0ecb8fb4
...
@@ -360,12 +360,12 @@ class Params4bit(torch.nn.Parameter):
...
@@ -360,12 +360,12 @@ class Params4bit(torch.nn.Parameter):
def
__torch_function__
(
cls
,
func
,
types
,
args
=
(),
kwargs
=
None
):
def
__torch_function__
(
cls
,
func
,
types
,
args
=
(),
kwargs
=
None
):
if
kwargs
is
None
:
if
kwargs
is
None
:
kwargs
=
{}
kwargs
=
{}
if
func
in
[
torch
.
chunk
,
torch
.
split
]:
if
func
in
[
torch
.
chunk
,
torch
.
split
]:
tensor
=
args
[
0
]
tensor
=
args
[
0
]
result
=
super
().
__torch_function__
(
func
,
types
,
args
,
kwargs
)
result
=
super
().
__torch_function__
(
func
,
types
,
args
,
kwargs
)
if
isinstance
(
result
,
tuple
):
if
isinstance
(
result
,
tuple
):
return
tuple
(
return
tuple
(
cls
(
cls
(
...
@@ -393,9 +393,9 @@ class Params4bit(torch.nn.Parameter):
...
@@ -393,9 +393,9 @@ class Params4bit(torch.nn.Parameter):
module
=
tensor
.
module
,
module
=
tensor
.
module
,
bnb_quantized
=
tensor
.
bnb_quantized
,
bnb_quantized
=
tensor
.
bnb_quantized
,
)
)
return
super
().
__torch_function__
(
func
,
types
,
args
,
kwargs
)
return
super
().
__torch_function__
(
func
,
types
,
args
,
kwargs
)
def
fix_4bit_weight_quant_state_from_module
(
module
:
Union
[
"Embedding4bit"
,
"Linear4bit"
]):
def
fix_4bit_weight_quant_state_from_module
(
module
:
Union
[
"Embedding4bit"
,
"Linear4bit"
]):
if
getattr
(
module
.
weight
,
"quant_state"
,
None
)
is
not
None
:
if
getattr
(
module
.
weight
,
"quant_state"
,
None
)
is
not
None
:
...
...
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