{"id":34034640,"url":"https://github.com/espnet/warp-ctc","last_synced_at":"2025-12-30T08:04:49.652Z","repository":{"id":57477614,"uuid":"191785393","full_name":"espnet/warp-ctc","owner":"espnet","description":"Pytorch Bindings for warp-ctc maintained by ESPnet","archived":false,"fork":true,"pushed_at":"2021-02-20T03:52:42.000Z","size":452,"stargazers_count":17,"open_issues_count":3,"forks_count":10,"subscribers_count":3,"default_branch":"pytorch_bindings","last_synced_at":"2025-12-15T11:29:56.749Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Cuda","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"jnishi/warp-ctc","license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/espnet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-06-13T15:08:25.000Z","updated_at":"2025-10-29T07:55:50.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/espnet/warp-ctc","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/espnet/warp-ctc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/espnet%2Fwarp-ctc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/espnet%2Fwarp-ctc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/espnet%2Fwarp-ctc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/espnet%2Fwarp-ctc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/espnet","download_url":"https://codeload.github.com/espnet/warp-ctc/tar.gz/refs/heads/pytorch_bindings","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/espnet%2Fwarp-ctc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28124757,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-30T02:00:05.476Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-12-13T19:56:03.960Z","updated_at":"2025-12-30T08:04:49.647Z","avatar_url":"https://github.com/espnet.png","language":"Cuda","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PyTorch bindings for Warp-ctc\n\n|branch|status|\n|:-:|:-:|\n|`pytorch_bindings`|[![Build Status](https://travis-ci.org/espnet/warp-ctc.svg?branch=pytorch_bindings)](https://github.com/espnet/warp-ctc/tree/pytorch_bindings)|\n|`pytorch-0.4`|[![Build Status](https://travis-ci.org/espnet/warp-ctc.svg?branch=pytorch-0.4)](https://github.com/espnet/warp-ctc/tree/pytorch-0.4)|\n|`pytorch-1.0`|[![Build Status](https://travis-ci.org/espnet/warp-ctc.svg?branch=pytorch-1.0)](https://github.com/espnet/warp-ctc/tree/pytorch-1.0)|\n\nThis is an extension onto the original repo found [here](https://github.com/baidu-research/warp-ctc).\n\n## Installation\n\nInstall [PyTorch](https://github.com/pytorch/pytorch#installation) first.\n\n`warpctc-pytorch` wheel uses [local version identifiers](https://www.python.org/dev/peps/pep-0440/#local-version-identifiers),\nwhich has a restriction that users have to specify the version explicitly.\n\n```console\n$ pip install warpctc-pytorch==X.X.X+torchYY.cudaZZ\n```\n\nThe latest version is 0.2.1 and if you work with PyTorch 1.6 and CUDA 10.2, you can run:\n\n```console\n$ pip install warpctc-pytorch==0.2.1+torch16.cuda102\n```\n\n### for PyTorch 1.4 - 1.6\n\n`warpctc-pytorch` wheels are provided for Python 3.8, 3.7, 3.6 and CUDA 10.2, 10.1, 10.0, 9.2.\n\n### for PyTorch 1.1 - 1.3\n\n`warpctc-pytorch` wheels are provided for Python 3.7, 3.6 and CUDA 10.2, 10.1, 10.0, 9.2.\n\n### for PyTorch 1.0\n\n`warpctc-pytorch10-cudaYY` wheels are provided for Python 3.7, 3.6 and CUDA 10.1, 10.0, 9.2, 9.1, 9.0, 8.0.\n\nIf you work with CUDA 10.1, you can run:\n\n```console\n$ pip install warpctc-pytorch10-cuda101\n```\n\n### for PyTorch 0.4.1\n\nWheels for PyTorch 0.4.1 are not provided so users have to build from source manually.\n\n`WARP_CTC_PATH` should be set to the location of a built WarpCTC\n(i.e. `libwarpctc.so`).  This defaults to `../build`, so from within a\nnew warp-ctc clone you could build WarpCTC like this:\n\n```bash\n$ git clone https://github.com/espnet/warp-ctc.git\n$ cd warp-ctc; git checkout -b pytorch-0.4 remotes/origin/pytorch-0.4\n$ mkdir build; cd build\n$ cmake ..\n$ make\n```\n\nNow install the bindings:\n```bash\n$ cd ../pytorch_binding\n$ pip install numpy cffi\n$ python setup.py install\n```\n\n## Example\n\nExample to use the bindings below.\n\n```python\nimport torch\nfrom warpctc_pytorch import CTCLoss\nctc_loss = CTCLoss()\n# expected shape of seqLength x batchSize x alphabet_size\nprobs = torch.FloatTensor([[[0.1, 0.6, 0.1, 0.1, 0.1], [0.1, 0.1, 0.6, 0.1, 0.1]]]).transpose(0, 1).contiguous()\nlabels = torch.IntTensor([1, 2])\nlabel_sizes = torch.IntTensor([2])\nprobs_sizes = torch.IntTensor([2])\nprobs.requires_grad_(True)  # tells autograd to compute gradients for probs\ncost = ctc_loss(probs, labels, probs_sizes, label_sizes)\ncost.backward()\n```\n\n## Documentation\n\n```\nCTCLoss(size_average=False, length_average=False, reduce=True)\n    # size_average (bool): normalize the loss by the batch size (default: False)\n    # length_average (bool): normalize the loss by the total number of frames in the batch. If True, supersedes size_average (default: False)\n    # reduce (bool): average or sum over observation for each minibatch.\n        If `False`, returns a loss per batch element instead and ignores `average` options.\n        (default: `True`)\n\nforward(acts, labels, act_lens, label_lens)\n    # acts: Tensor of (seqLength x batch x outputDim) containing output activations from network (before softmax)\n    # labels: 1 dimensional Tensor containing all the targets of the batch in one large sequence\n    # act_lens: Tensor of size (batch) containing size of each output sequence from the network\n    # label_lens: Tensor of (batch) containing label length of each example\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fespnet%2Fwarp-ctc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fespnet%2Fwarp-ctc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fespnet%2Fwarp-ctc/lists"}