Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion einops/packing.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ def pack(tensors: Sequence[Tensor], pattern: str) -> tuple[Tensor, list[Shape]]:
"""
n_axes_before, n_axes_after, min_axes = analyze_pattern(pattern, "pack")

# packing zero tensors is illegal
if len(tensors) == 0:
raise EinopsError("pack() requires at least one tensor, got empty list")

backend = get_backend(tensors[0])

reshaped_tensors: list[Tensor] = []
Expand Down
2 changes: 1 addition & 1 deletion einops/parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def check_axis_name_return_reason(name: str, allow_underscore: bool = False) ->
elif name[0] == "_" or name[-1] == "_":
if name == "_" and allow_underscore:
return True, ""
return False, "axis name should should not start or end with underscore"
return False, "axis name should not start or end with underscore"
else:
if keyword.iskeyword(name):
warnings.warn(
Expand Down
Loading