Skip to content

Commit

Permalink
fix empty lines
Browse files Browse the repository at this point in the history
  • Loading branch information
haolin-nju committed Jan 3, 2025
1 parent 6c8ebeb commit 4526338
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions chatlearn/utils/dist_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,15 @@
import torch
from torch._utils import _flatten_dense_tensors, _unflatten_dense_tensors


def bucket_tensors(tensors, bucket_size_mb):
"""Group tensors into chunks. We seperate sparse and dense tensor,
each containing tensors of same type up to certain byte limit in total size.
Args:
tensors (Sequence): A sequence of tensors to be separated into chunks.
size_limit (int): The limit of each chunk in bytes.
Return:
dense_buckets: Blocks of tensors of same type and within size_limit.
sparse_bucket: A list of sparse tensors
Expand Down

0 comments on commit 4526338

Please sign in to comment.