{"id":19001188,"url":"https://github.com/oneflow-inc/one-fx","last_synced_at":"2025-07-30T11:10:41.357Z","repository":{"id":72510822,"uuid":"578836250","full_name":"Oneflow-Inc/one-fx","owner":"Oneflow-Inc","description":"A toolkit for developers to simplify the transformation of nn.Module instances. It's now corresponding to Pytorch.fx.","archived":false,"fork":false,"pushed_at":"2023-04-07T07:09:10.000Z","size":283,"stargazers_count":13,"open_issues_count":3,"forks_count":1,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-22T17:13:34.446Z","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":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Oneflow-Inc.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-16T01:52:19.000Z","updated_at":"2023-10-08T07:36:48.000Z","dependencies_parsed_at":"2024-06-21T12:59:55.068Z","dependency_job_id":"d3446e61-d093-485c-b181-201664920973","html_url":"https://github.com/Oneflow-Inc/one-fx","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/Oneflow-Inc/one-fx","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Oneflow-Inc%2Fone-fx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Oneflow-Inc%2Fone-fx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Oneflow-Inc%2Fone-fx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Oneflow-Inc%2Fone-fx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Oneflow-Inc","download_url":"https://codeload.github.com/Oneflow-Inc/one-fx/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Oneflow-Inc%2Fone-fx/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267858218,"owners_count":24155917,"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-07-30T02:00:09.044Z","response_time":70,"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":"2024-11-08T18:10:18.670Z","updated_at":"2025-07-30T11:10:41.318Z","avatar_url":"https://github.com/Oneflow-Inc.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# one-fx\n\n[![PyPI version](https://img.shields.io/pypi/v/onefx.svg)](https://pypi.org/project/onefx/)\n[![PyPI pyversions](https://img.shields.io/pypi/pyversions/onefx.svg)](https://pypi.org/project/onefx/)\n[![PyPI license](https://img.shields.io/pypi/l/onefx.svg)](https://pypi.org/project/onefx/)\n\nA toolkit for developers to simplify the transformation of nn.Module instances. It is modified from `Pytorch.fx`.\n\n\n## install\n\n```shell\npip install onefx\n```\n\n[Oneflow](https://github.com/Oneflow-Inc/oneflow) has now add `one-fx` as default dependency. You can also install oneflow and use it as `oneflow.fx`.\n\n## usage\n\nThe following code shows the basic usage. For more examples, please refer to `https://github.com/Oneflow-Inc/one-fx/tree/main/onefx/exmaples`.\n\n```python\nimport oneflow\nimport onefx as fx\n\nclass MyModule(oneflow.nn.Module):\n    def __init__(self, do_activation : bool = False):\n        super().__init__()\n        self.do_activation = do_activation\n        self.linear = oneflow.nn.Linear(512, 512)\n\n    def forward(self, x):\n        x = self.linear(x)\n        x = oneflow.relu(x)\n        y = oneflow.ones([2, 3])\n\n        if self.do_activation:\n            x = oneflow.relu(x)\n        return y\n\nwithout_activation = MyModule(do_activation=False)\nwith_activation = MyModule(do_activation=True)\n\ntraced_without_activation = onefx.symbolic_trace(without_activation)\nprint(traced_without_activation.code)\n\"\"\"\ndef forward(self, x):\n    linear = self.linear(x);  x = None\n    return linear\n\"\"\"\n\ntraced_with_activation = onefx.symbolic_trace(with_activation)\nprint(traced_with_activation.code)\n\"\"\"\nwrap(\"oneflow._oneflow_internal._C.relu\")\n\ndef forward(self, x):\n    linear = self.linear(x);  x = None\n    relu = oneflow._oneflow_internal._C.relu(linear);  linear = None\n    return relu\n\"\"\"\n```\n\n## version map\n\n| oneflow | one-fx |\n| ------- | ------- |\n| \u003e=0.9.0 | 0.0.2, 0.0.3 |","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foneflow-inc%2Fone-fx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foneflow-inc%2Fone-fx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foneflow-inc%2Fone-fx/lists"}