Skip to content

Commit 3d77d5f

Browse files
committed
remove: save_iter an unused function
1 parent b535228 commit 3d77d5f

File tree

1 file changed

+1
-26
lines changed

1 file changed

+1
-26
lines changed

binding/python/py/bintensors/torch.py

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -263,32 +263,6 @@ def save(tensors: Dict[str, torch.Tensor], metadata: Optional[Dict[str, str]] =
263263
return result
264264

265265

266-
def save_iter(tensors: Dict[str, torch.Tensor], metadata: Optional[Dict[str, str]] = None):
267-
"""
268-
Saves a dictionary of tensors into raw bytes in bintensors format.
269-
270-
Args:
271-
tensors (`Dict[str, torch.Tensor]`):
272-
The incoming tensors. Tensors need to be contiguous and dense.
273-
metadata (`Dict[str, str]`, *optional*, defaults to `None`):
274-
Optional text only metadata you might want to save in your header.
275-
For instance it can be useful to specify more about the underlying
276-
tensors. This is purely informative and does not affect tensor loading.
277-
278-
Returns:
279-
`bytes`: The raw bytes representing the format
280-
281-
Example:
282-
283-
```python
284-
from bintensors.torch import save_iter
285-
import torch
286-
287-
tensors = {"embedding": torch.zeros((512, 1024)), "attention": torch.zeros((256, 256))}
288-
buffer = save_iter(tensors)
289-
```
290-
"""
291-
292266
def save_with_checksum(
293267
tensor_dict: Dict[str, torch.Tensor],
294268
metadata: Optional[Dict[str, str]] = None,
@@ -459,6 +433,7 @@ def _getdtype(dtype_str: str) -> Optional[torch.dtype]:
459433

460434

461435
def _view2torch(safeview) -> Dict[str, torch.Tensor]:
436+
""""""
462437
result = {}
463438
for k, v in safeview:
464439
dtype = _getdtype(v["dtype"])

0 commit comments

Comments
 (0)