{"id":18474233,"url":"https://github.com/dneprdroid/pytorch-coreml-custom-layer-example","last_synced_at":"2025-08-01T14:08:25.241Z","repository":{"id":41288548,"uuid":"437229587","full_name":"dneprDroid/pytorch-coreml-custom-layer-example","owner":"dneprDroid","description":"PyTorch to CoreML: Writing custom layers with Metal shaders - torch.nn.functional.grid_sample operation","archived":false,"fork":false,"pushed_at":"2024-06-04T10:43:50.000Z","size":26980,"stargazers_count":16,"open_issues_count":4,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-10T10:16:17.920Z","etag":null,"topics":["coreml","coremltools","ios","metal","ml","pytorch","swift"],"latest_commit_sha":null,"homepage":"https://medium.com/@ovechko.056/pytorch-to-coreml-writing-custom-layers-with-metal-e8922b51895","language":"Swift","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/dneprDroid.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":"2021-12-11T08:38:31.000Z","updated_at":"2025-04-09T10:19:59.000Z","dependencies_parsed_at":"2024-06-04T12:09:48.923Z","dependency_job_id":null,"html_url":"https://github.com/dneprDroid/pytorch-coreml-custom-layer-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dneprDroid/pytorch-coreml-custom-layer-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dneprDroid%2Fpytorch-coreml-custom-layer-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dneprDroid%2Fpytorch-coreml-custom-layer-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dneprDroid%2Fpytorch-coreml-custom-layer-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dneprDroid%2Fpytorch-coreml-custom-layer-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dneprDroid","download_url":"https://codeload.github.com/dneprDroid/pytorch-coreml-custom-layer-example/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dneprDroid%2Fpytorch-coreml-custom-layer-example/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268240561,"owners_count":24218360,"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-01T02:00:08.611Z","response_time":67,"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":["coreml","coremltools","ios","metal","ml","pytorch","swift"],"created_at":"2024-11-06T10:28:37.508Z","updated_at":"2025-08-01T14:08:25.208Z","avatar_url":"https://github.com/dneprDroid.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pytorch-coreml-custom-layer-example\nPyTorch to CoreML: Writing custom layers with Metal\n\n\u003cimg width=\"200\" alt=\"pytorch-demo-image\" src=\"https://user-images.githubusercontent.com/13742733/176658252-533cdf6f-a993-4c1c-9393-2a926398f653.png\"\u003e\n\n## Convert PyTorch model\n\n```bash\n\ncd Convert\npython3 -m pip install -r requirements.txt\npython3 convert.py -o /path/to/output/resulting/mlmodel/file\n\n ```\n\n## Run the demo app\nOpen `TorchCoreMLDemo.xcodeproj` in Xcode, build and run the app.\n\n## Shader \nThe code of the grid sample Metal-shader is [here](./TorchCoreMLDemo/TorchCoreMLDemo/Metal/GridSample.metal).\n\nMore information about grid sample (warper) algorithm you can find [here](https://pytorch.org/docs/stable/generated/torch.nn.functional.grid_sample.html).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdneprdroid%2Fpytorch-coreml-custom-layer-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdneprdroid%2Fpytorch-coreml-custom-layer-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdneprdroid%2Fpytorch-coreml-custom-layer-example/lists"}