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
db49ad43
Unverified
Commit
db49ad43
authored
Jun 01, 2023
by
shadeMe
Browse files
Add `device` parameter to `Embedding`
parent
9cac5dd1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
bitsandbytes/nn/modules.py
bitsandbytes/nn/modules.py
+2
-0
No files found.
bitsandbytes/nn/modules.py
View file @
db49ad43
...
@@ -92,6 +92,7 @@ class Embedding(torch.nn.Embedding):
...
@@ -92,6 +92,7 @@ class Embedding(torch.nn.Embedding):
scale_grad_by_freq
:
bool
=
False
,
scale_grad_by_freq
:
bool
=
False
,
sparse
:
bool
=
False
,
sparse
:
bool
=
False
,
_weight
:
Optional
[
Tensor
]
=
None
,
_weight
:
Optional
[
Tensor
]
=
None
,
device
:
Optional
[
device
]
=
None
,
)
->
None
:
)
->
None
:
super
().
__init__
(
super
().
__init__
(
num_embeddings
,
num_embeddings
,
...
@@ -102,6 +103,7 @@ class Embedding(torch.nn.Embedding):
...
@@ -102,6 +103,7 @@ class Embedding(torch.nn.Embedding):
scale_grad_by_freq
,
scale_grad_by_freq
,
sparse
,
sparse
,
_weight
,
_weight
,
device
=
device
)
)
GlobalOptimManager
.
get_instance
().
register_module_override
(
GlobalOptimManager
.
get_instance
().
register_module_override
(
self
,
"weight"
,
{
"optim_bits"
:
32
}
self
,
"weight"
,
{
"optim_bits"
:
32
}
...
...
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