Skip to content

docs(operations): add missing docstrings to predicate utility functions#4095

Open
RavSinghChandan wants to merge 1 commit into
huggingface:mainfrom
RavSinghChandan:docs/add-missing-docstrings-operations
Open

docs(operations): add missing docstrings to predicate utility functions#4095
RavSinghChandan wants to merge 1 commit into
huggingface:mainfrom
RavSinghChandan:docs/add-missing-docstrings-operations

Conversation

@RavSinghChandan

Copy link
Copy Markdown

Summary

Three small public predicate functions in src/accelerate/utils/operations.py had no docstrings, making their purpose, expected input type, and return value invisible to IDE tooling and contributors:

Function What was added
is_torch_tensor Args + Returns
is_torch_xpu_tensor Args + Returns (lists all 7 XPU tensor types checked)
is_tensor_information Args + Returns

The docstring style follows the existing pattern used throughout operations.py (e.g. is_namedtuple, honor_type, recursively_apply).

No logic changes

Documentation only — no behaviour was modified.

CI

  • ruff check (with project config) ✅
  • ruff format --check

Add Args/Returns docstrings to is_torch_tensor, is_torch_xpu_tensor,
is_tensor_information
@RavSinghChandan RavSinghChandan force-pushed the docs/add-missing-docstrings-operations branch from 39a35a8 to 3517d9e Compare July 1, 2026 02:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant