mirror of
https://github.com/huggingface/transformers.git
synced 2025-08-02 19:21:31 +06:00
Fix slicing for 0-dim param (#36580)
* fix * switch to ellipsis instead * Add co-author Co-authored-by: fxmarty-amd <fxmarty-amd@users.noreply.github.com> * Add co-author second try Co-authored-by: fxmarty-amd <felmarty@amd.com>
This commit is contained in:
parent
fbb18ce68b
commit
bc3d5781e7
@ -531,7 +531,7 @@ def shard_and_distribute_module(
|
||||
param, empty_param, param_type, param_casting_dtype, is_contiguous, rank, device_mesh
|
||||
)
|
||||
else:
|
||||
param = param[:]
|
||||
param = param[...]
|
||||
if is_contiguous:
|
||||
param = param.contiguous()
|
||||
|
||||
|
@ -795,7 +795,7 @@ def _load_state_dict_into_meta_model(
|
||||
device_mesh,
|
||||
)
|
||||
else:
|
||||
param = param[:]
|
||||
param = param[...]
|
||||
if casting_dtype is not None:
|
||||
param = param.to(casting_dtype)
|
||||
if to_contiguous:
|
||||
|
Loading…
Reference in New Issue
Block a user