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
262350c1
Unverified
Commit
262350c1
authored
Nov 29, 2021
by
Tim Dettmers
Committed by
GitHub
Nov 29, 2021
Browse files
Merge pull request #14 from SirRob1997/main
[FIX] passing of sparse in StableEmbedding
parents
037022e8
67a12835
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
bitsandbytes/nn/modules.py
bitsandbytes/nn/modules.py
+2
-2
No files found.
bitsandbytes/nn/modules.py
View file @
262350c1
...
@@ -15,8 +15,8 @@ from bitsandbytes.optim import GlobalOptimManager
...
@@ -15,8 +15,8 @@ from bitsandbytes.optim import GlobalOptimManager
class
StableEmbedding
(
torch
.
nn
.
Embedding
):
class
StableEmbedding
(
torch
.
nn
.
Embedding
):
def
__init__
(
self
,
num_embeddings
:
int
,
embedding_dim
:
int
,
padding_idx
:
Optional
[
int
]
=
None
,
def
__init__
(
self
,
num_embeddings
:
int
,
embedding_dim
:
int
,
padding_idx
:
Optional
[
int
]
=
None
,
max_norm
:
Optional
[
float
]
=
None
,
norm_type
:
float
=
2.
,
scale_grad_by_freq
:
bool
=
False
,
max_norm
:
Optional
[
float
]
=
None
,
norm_type
:
float
=
2.
,
scale_grad_by_freq
:
bool
=
False
,
sparse
:
bool
=
Tru
e
,
_weight
:
Optional
[
Tensor
]
=
None
)
->
None
:
sparse
:
bool
=
Fals
e
,
_weight
:
Optional
[
Tensor
]
=
None
)
->
None
:
super
(
StableEmbedding
,
self
).
__init__
(
num_embeddings
,
embedding_dim
,
padding_idx
,
max_norm
,
norm_type
,
scale_grad_by_freq
,
Fal
se
,
_weight
)
super
(
StableEmbedding
,
self
).
__init__
(
num_embeddings
,
embedding_dim
,
padding_idx
,
max_norm
,
norm_type
,
scale_grad_by_freq
,
spar
se
,
_weight
)
self
.
norm
=
torch
.
nn
.
LayerNorm
(
embedding_dim
)
self
.
norm
=
torch
.
nn
.
LayerNorm
(
embedding_dim
)
GlobalOptimManager
.
get_instance
().
register_parameters
(
self
.
weight
)
GlobalOptimManager
.
get_instance
().
register_parameters
(
self
.
weight
)
GlobalOptimManager
.
get_instance
().
override_config
(
self
.
weight
,
'optim_bits'
,
32
)
GlobalOptimManager
.
get_instance
().
override_config
(
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