Skip to content

Conversation

@raimbekovm
Copy link
Contributor

@raimbekovm raimbekovm commented Dec 25, 2025

Summary

Add Google-style docstrings to helper utilities in timm/:

layers/helpers.py: _ntuple(), make_divisible(), extend_tuple()
layers/space_to_depth.py: SpaceToDepth, DepthToSpace
layers/format.py: get_spatial_dim(), get_channel_dim(), nchw_to(), nhwc_to()
layers/pool1d.py: global_pool_nlc()
layers/activations_me.py: swish_fwd(), swish_bwd(), mish_fwd(), mish_bwd(), hard_sigmoid_fwd(), hard_sigmoid_bwd(), hard_swish_fwd(), hard_swish_bwd(), hard_mish_fwd(), hard_mish_bwd()
models/_prune.py: extract_layer(), set_layer(), adapt_model_from_string(), adapt_model_from_file()

Core utility functions and modules used throughout the codebase that previously lacked documentation.

Changes

  • Added docstrings following Google style guide as specified in CONTRIBUTING.md
  • No functional code changes

Testing

  • Verified Python syntax with py_compile
  • No breaking changes (documentation only)

Add Google-style docstrings for _ntuple, make_divisible, and extend_tuple
to improve code documentation and usage clarity.
Add Google-style docstrings for SpaceToDepth and DepthToSpace layers
to document spatial-channel dimension rearrangement operations.
@raimbekovm raimbekovm changed the title Add docstrings to helper functions in layers/helpers.py Add docstrings to layer helper functions and modules Dec 25, 2025
Add Google-style docstrings for get_spatial_dim, get_channel_dim,
nchw_to, and nhwc_to functions in layers/format.py.
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@rwightman rwightman merged commit d4ab516 into huggingface:main Dec 26, 2025
22 checks passed
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.

3 participants