{"id":26795,"library":"batchtensor","title":"batchtensor","description":"A Python library providing utility functions to manipulate batches of PyTorch tensors, such as concatenation, indexing, and nested data operations. Current version 0.1.1 supports Python 3.10-3.14 and PyTorch. The library follows a semantic versioning release cadence with regular updates.","status":"active","version":"0.1.1","language":"python","source_language":"en","source_url":"https://github.com/durandtibo/batchtensor","tags":["pytorch","tensor","batch","deep-learning","utility"],"install":[{"cmd":"pip install batchtensor","lang":"bash","label":"Default install"}],"dependencies":[{"reason":"Core dependency: batchtensor operates on PyTorch tensors","package":"torch","optional":false}],"imports":[{"note":"Common mistake: trying to import from submodules like 'batchtensor.nested' before checking top-level exports.","wrong":"","symbol":"cat_along_batch","correct":"from batchtensor import cat_along_batch"},{"note":"nested_apply is in the nested submodule, not directly in batchtensor.","wrong":"from batchtensor import nested_apply","symbol":"nested_apply","correct":"from batchtensor.nested import nested_apply"}],"quickstart":{"code":"import torch\nfrom batchtensor import cat_along_batch\n\ntensor1 = torch.randn(2, 3)\ntensor2 = torch.randn(3, 3)\nresult = cat_along_batch([tensor1, tensor2])\nprint(result.shape)  # torch.Size([5, 3])","lang":"python","description":"Basic usage: concatenate a list of tensors along the batch dimension."},"warnings":[{"fix":"Upgrade and update function calls per changelog.","message":"Version 0.0.4 introduced breaking changes (see release notes). Functions may have been renamed or arguments changed.","severity":"breaking","affected_versions":"<0.0.4"},{"fix":"Ensure input is a dict or list of tensors, not a single tensor.","message":"batchtensor uses nested functions (e.g., nested_apply, nested_map) that expect nested structures of tensors. Passing plain tensors may raise unexpected errors.","severity":"gotcha","affected_versions":"all"},{"fix":"Review deprecation warnings and migrate to recommended alternatives.","message":"Some functions may be deprecated in future releases. Check the release notes before upgrading.","severity":"deprecated","affected_versions":">=0.1.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use: from batchtensor.nested import nested_apply","cause":"Incorrect import path: nested_apply is in batchtensor.nested subpackage.","error":"ImportError: cannot import name 'nested_apply' from 'batchtensor'"},{"fix":"Install latest version: pip install --upgrade batchtensor","cause":"Attempting to import after a partial installation or using an older version that did not export cat_along_batch at top level.","error":"AttributeError: module 'batchtensor' has no attribute 'cat_along_batch'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}