{"id":25624184,"url":"https://github.com/lebellig/dim-checker","last_synced_at":"2025-08-19T21:21:30.558Z","repository":{"id":154379178,"uuid":"554238874","full_name":"lebellig/dim-checker","owner":"lebellig","description":null,"archived":false,"fork":false,"pushed_at":"2022-11-29T14:47:30.000Z","size":47,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-22T12:30:37.879Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lebellig.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-19T13:33:10.000Z","updated_at":"2022-10-19T13:33:18.000Z","dependencies_parsed_at":"2023-04-29T17:19:21.333Z","dependency_job_id":null,"html_url":"https://github.com/lebellig/dim-checker","commit_stats":null,"previous_names":["lebellig/dim-checker"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lebellig/dim-checker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lebellig%2Fdim-checker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lebellig%2Fdim-checker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lebellig%2Fdim-checker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lebellig%2Fdim-checker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lebellig","download_url":"https://codeload.github.com/lebellig/dim-checker/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lebellig%2Fdim-checker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271223826,"owners_count":24721753,"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-08-19T02:00:09.176Z","response_time":63,"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-02-22T12:26:45.674Z","updated_at":"2025-08-19T21:21:30.455Z","avatar_url":"https://github.com/lebellig.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DimChecker\n\nUseful tool for functions, neural networks, or callable objects outputs dimensions checking. It allows fast testing and relies on pattern string for easy use. \n```python\nDimChecker().test_dims(nn, \"bcl-\u003ebn(2*c+1)l\", n=16)\n```\n\n\n## Define Pattern\n\n### Write pattern\n\nA pattern is defined as two formulas separated by an arrow:\n\n```python\npattern = \"bcl -\u003e b(2*c)l\"\nDimChecker().test_dims(nn, pattern)\n```\nOn the left side of the arrow we have the _inputs formula_ and the _outputs formula_ on the right.\n\n\n```python\nin_formula = \"bcl\"\nout_formula = \"b(2*c)l\"\npattern = in_formula + \"-\u003e\" + out_formula\nDimChecker().test_dims(nn, pattern)\n```\n\n### Write formulas\n\n#### simple case\n\n\nDimensions are defined by a single letter. Here a common machine learning input tensor of shape $\\textit{Batch} \\times \\textit{Channel} \\times \\textit{Length}$ :\n```python\nformula = \"bcl\"\n```\nFor 2D images of shape $\\textit{Batch} \\times \\textit{Channel} \\times \\textit{Height} \\times \\textit{Width}$ we may use:\n\n```python\nformula = \"bchw\"\n```\n\n#### arithmetical expression\n\n\n\n#### several inputs or outputs\n\nTo use several inputs or outputs we only need to separate them by commas:\n```python\n# several inputs\npattern = \"bcl, bl -\u003e bcl\"\n# several outputs\npattern = \"bcl -\u003e bcl, bl\"\n# several inputs or outputs\npattern = \"bcl, bc -\u003ebcl, bl\"\nDimChecker().test_dims(nn, pattern)\n```\n\n## Add Constraints\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flebellig%2Fdim-checker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flebellig%2Fdim-checker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flebellig%2Fdim-checker/lists"}