{"id":19898949,"url":"https://github.com/bbergerud/tenops","last_synced_at":"2026-01-20T03:03:34.197Z","repository":{"id":242616390,"uuid":"810082153","full_name":"bbergerud/tenops","owner":"bbergerud","description":"Creating a common interface for numpy, pytorch, tensorflow, etc.","archived":false,"fork":false,"pushed_at":"2024-06-09T02:28:19.000Z","size":126,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-28T03:34:10.347Z","etag":null,"topics":["numpy","pytorch","tensorflow"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bbergerud.png","metadata":{"files":{"readme":"readme.md","changelog":"CHANGELOG.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-06-04T02:32:26.000Z","updated_at":"2024-06-09T02:28:21.000Z","dependencies_parsed_at":"2025-09-08T21:53:31.274Z","dependency_job_id":"d4e613f3-6562-411f-a4b8-cb4256d0399e","html_url":"https://github.com/bbergerud/tenops","commit_stats":null,"previous_names":["bbergerud/dops","bbergerud/tenops"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/bbergerud/tenops","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbergerud%2Ftenops","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbergerud%2Ftenops/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbergerud%2Ftenops/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbergerud%2Ftenops/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bbergerud","download_url":"https://codeload.github.com/bbergerud/tenops/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbergerud%2Ftenops/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28594958,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T02:08:49.799Z","status":"ssl_error","status_checked_at":"2026-01-20T02:08:44.148Z","response_time":117,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["numpy","pytorch","tensorflow"],"created_at":"2024-11-12T20:06:33.587Z","updated_at":"2026-01-20T03:03:34.182Z","avatar_url":"https://github.com/bbergerud.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ten(sor) Op(eration)s\n\nThe basic idea behind this repository is to allow for seamlessly switching between libraries like numpy, pytorch, and tensorflow by checking the input types and returning the proper function for use in some operation.\n\n## Installation\nInstallation can be done over pip\n```\npip install tenops\n```\n\nNote that for the library to work you'll need to have at least one of the following libraries installed:\n- numpy\n- torch\n- tensorflow\n\n## Usage\n\nFunctions work like regular functions, one just needs to pass in the object and the function will identify the corresponding module and use the appropriate function:\n\n```\n\u003e\u003e\u003e import torch, numpy, tensorflow as tf\n\u003e\u003e\u003e from tenops.special import exp\n\u003e\u003e\u003e exp(numpy.array([0]))\narray([1.])\n\u003e\u003e\u003e exp(torch.tensor([0]))\ntensor([1.])\n\u003e\u003e\u003e exp(tf.constant([0.]))\n\u003ctf.Tensor: shape=(1,), dtype=float32, numpy=array([1.], dtype=float32)\u003e\n```\n\nOne can also just specify the module using the `default` parameter rather than typecasting directly (note that this requires that the specified library is installed):\n\n```\n\u003e\u003e\u003e from tenops.special import exp\n\u003e\u003e\u003e exp([0], default=\"numpy\")\narray([1.])\n\u003e\u003e\u003e exp([0], default=\"torch\")\ntensor([1.])\n\u003e\u003e\u003e exp([0.], default=\"tensorflow\")\n\u003ctf.Tensor: shape=(1,), dtype=float32, numpy=array([1.], dtype=float32)\u003e\n```\n\n\n## Development\n\n[Poetry](https://python-poetry.org/docs/) is used to manage the build process.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbergerud%2Ftenops","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbbergerud%2Ftenops","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbergerud%2Ftenops/lists"}