Kernels
kernels-bot commited on
Commit
ceb1cda
·
verified ·
1 Parent(s): d0b2454

Uploaded using `kernel-builder`.

Browse files
Files changed (25) hide show
  1. .gitattributes +3 -0
  2. build/torch210-cpu-aarch64-darwin/_ops.py +3 -3
  3. build/torch210-cpu-aarch64-darwin/{_relu_cpu_86f75d9.abi3.so → _relu_cpu_c835f43.abi3.so} +0 -0
  4. build/torch210-cpu-aarch64-darwin/metadata.json +1 -1
  5. build/torch210-metal-aarch64-darwin/_ops.py +3 -3
  6. build/torch210-metal-aarch64-darwin/{_relu_metal_86f75d9.abi3.so → _relu_metal_c835f43.abi3.so} +1 -1
  7. build/torch210-metal-aarch64-darwin/metadata.json +1 -1
  8. build/torch211-cpu-aarch64-darwin/_ops.py +3 -3
  9. build/torch211-cpu-aarch64-darwin/{_relu_cpu_86f75d9.abi3.so → _relu_cpu_c835f43.abi3.so} +0 -0
  10. build/torch211-cpu-aarch64-darwin/metadata.json +1 -1
  11. build/torch211-metal-aarch64-darwin/_ops.py +3 -3
  12. build/torch211-metal-aarch64-darwin/{_relu_metal_86f75d9.abi3.so → _relu_metal_c835f43.abi3.so} +1 -1
  13. build/torch211-metal-aarch64-darwin/metadata.json +1 -1
  14. build/torch212-cpu-aarch64-darwin/__init__.py +16 -0
  15. build/torch212-cpu-aarch64-darwin/_ops.py +9 -0
  16. build/torch212-cpu-aarch64-darwin/_relu_cpu_c835f43.abi3.so +0 -0
  17. build/torch212-cpu-aarch64-darwin/layers/__init__.py +11 -0
  18. build/torch212-cpu-aarch64-darwin/metadata.json +10 -0
  19. build/torch212-cpu-aarch64-darwin/relu/__init__.py +26 -0
  20. build/torch212-metal-aarch64-darwin/__init__.py +16 -0
  21. build/torch212-metal-aarch64-darwin/_ops.py +9 -0
  22. build/torch212-metal-aarch64-darwin/_relu_metal_c835f43.abi3.so +3 -0
  23. build/torch212-metal-aarch64-darwin/layers/__init__.py +11 -0
  24. build/torch212-metal-aarch64-darwin/metadata.json +10 -0
  25. build/torch212-metal-aarch64-darwin/relu/__init__.py +26 -0
.gitattributes CHANGED
@@ -585,3 +585,6 @@ build/torch212-cxx11-cpu-aarch64-linux/_relu_cpu_c835f43.abi3.so filter=lfs diff
585
  build/torch212-cxx11-cu126-aarch64-linux/_relu_cuda_c835f43.abi3.so filter=lfs diff=lfs merge=lfs -text
586
  build/torch212-cxx11-cu130-aarch64-linux/_relu_cuda_c835f43.abi3.so filter=lfs diff=lfs merge=lfs -text
587
  build/torch212-cxx11-cu132-aarch64-linux/_relu_cuda_c835f43.abi3.so filter=lfs diff=lfs merge=lfs -text
 
 
 
 
585
  build/torch212-cxx11-cu126-aarch64-linux/_relu_cuda_c835f43.abi3.so filter=lfs diff=lfs merge=lfs -text
586
  build/torch212-cxx11-cu130-aarch64-linux/_relu_cuda_c835f43.abi3.so filter=lfs diff=lfs merge=lfs -text
587
  build/torch212-cxx11-cu132-aarch64-linux/_relu_cuda_c835f43.abi3.so filter=lfs diff=lfs merge=lfs -text
588
+ build/torch210-metal-aarch64-darwin/_relu_metal_c835f43.abi3.so filter=lfs diff=lfs merge=lfs -text
589
+ build/torch211-metal-aarch64-darwin/_relu_metal_c835f43.abi3.so filter=lfs diff=lfs merge=lfs -text
590
+ build/torch212-metal-aarch64-darwin/_relu_metal_c835f43.abi3.so filter=lfs diff=lfs merge=lfs -text
build/torch210-cpu-aarch64-darwin/_ops.py CHANGED
@@ -1,9 +1,9 @@
1
  import torch
2
- from . import _relu_cpu_86f75d9
3
- ops = torch.ops._relu_cpu_86f75d9
4
 
5
  def add_op_namespace_prefix(op_name: str):
6
  """
7
  Prefix op by namespace.
8
  """
9
- return f"_relu_cpu_86f75d9::{op_name}"
 
1
  import torch
2
+ from . import _relu_cpu_c835f43
3
+ ops = torch.ops._relu_cpu_c835f43
4
 
5
  def add_op_namespace_prefix(op_name: str):
6
  """
7
  Prefix op by namespace.
8
  """
9
+ return f"_relu_cpu_c835f43::{op_name}"
build/torch210-cpu-aarch64-darwin/{_relu_cpu_86f75d9.abi3.so → _relu_cpu_c835f43.abi3.so} RENAMED
Binary files a/build/torch210-cpu-aarch64-darwin/_relu_cpu_86f75d9.abi3.so and b/build/torch210-cpu-aarch64-darwin/_relu_cpu_c835f43.abi3.so differ
 
build/torch210-cpu-aarch64-darwin/metadata.json CHANGED
@@ -1,6 +1,6 @@
1
  {
2
  "name": "relu",
3
- "id": "_relu_cpu_86f75d9",
4
  "version": 1,
5
  "license": "Apache-2.0",
6
  "python-depends": [],
 
1
  {
2
  "name": "relu",
3
+ "id": "_relu_cpu_c835f43",
4
  "version": 1,
5
  "license": "Apache-2.0",
6
  "python-depends": [],
build/torch210-metal-aarch64-darwin/_ops.py CHANGED
@@ -1,9 +1,9 @@
1
  import torch
2
- from . import _relu_metal_86f75d9
3
- ops = torch.ops._relu_metal_86f75d9
4
 
5
  def add_op_namespace_prefix(op_name: str):
6
  """
7
  Prefix op by namespace.
8
  """
9
- return f"_relu_metal_86f75d9::{op_name}"
 
1
  import torch
2
+ from . import _relu_metal_c835f43
3
+ ops = torch.ops._relu_metal_c835f43
4
 
5
  def add_op_namespace_prefix(op_name: str):
6
  """
7
  Prefix op by namespace.
8
  """
9
+ return f"_relu_metal_c835f43::{op_name}"
build/torch210-metal-aarch64-darwin/{_relu_metal_86f75d9.abi3.so → _relu_metal_c835f43.abi3.so} RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:5eaaa06ca9c418906845168dc55267c2e25c0334ca1f283f002cc69f3bec37d8
3
  size 100920
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e40bcf2bc30205656118bb28d8fc9628650cac07fc4217dc206aaa39fe336877
3
  size 100920
build/torch210-metal-aarch64-darwin/metadata.json CHANGED
@@ -1,6 +1,6 @@
1
  {
2
  "name": "relu",
3
- "id": "_relu_metal_86f75d9",
4
  "version": 1,
5
  "license": "Apache-2.0",
6
  "python-depends": [],
 
1
  {
2
  "name": "relu",
3
+ "id": "_relu_metal_c835f43",
4
  "version": 1,
5
  "license": "Apache-2.0",
6
  "python-depends": [],
build/torch211-cpu-aarch64-darwin/_ops.py CHANGED
@@ -1,9 +1,9 @@
1
  import torch
2
- from . import _relu_cpu_86f75d9
3
- ops = torch.ops._relu_cpu_86f75d9
4
 
5
  def add_op_namespace_prefix(op_name: str):
6
  """
7
  Prefix op by namespace.
8
  """
9
- return f"_relu_cpu_86f75d9::{op_name}"
 
1
  import torch
2
+ from . import _relu_cpu_c835f43
3
+ ops = torch.ops._relu_cpu_c835f43
4
 
5
  def add_op_namespace_prefix(op_name: str):
6
  """
7
  Prefix op by namespace.
8
  """
9
+ return f"_relu_cpu_c835f43::{op_name}"
build/torch211-cpu-aarch64-darwin/{_relu_cpu_86f75d9.abi3.so → _relu_cpu_c835f43.abi3.so} RENAMED
Binary files a/build/torch211-cpu-aarch64-darwin/_relu_cpu_86f75d9.abi3.so and b/build/torch211-cpu-aarch64-darwin/_relu_cpu_c835f43.abi3.so differ
 
build/torch211-cpu-aarch64-darwin/metadata.json CHANGED
@@ -1,6 +1,6 @@
1
  {
2
  "name": "relu",
3
- "id": "_relu_cpu_86f75d9",
4
  "version": 1,
5
  "license": "Apache-2.0",
6
  "python-depends": [],
 
1
  {
2
  "name": "relu",
3
+ "id": "_relu_cpu_c835f43",
4
  "version": 1,
5
  "license": "Apache-2.0",
6
  "python-depends": [],
build/torch211-metal-aarch64-darwin/_ops.py CHANGED
@@ -1,9 +1,9 @@
1
  import torch
2
- from . import _relu_metal_86f75d9
3
- ops = torch.ops._relu_metal_86f75d9
4
 
5
  def add_op_namespace_prefix(op_name: str):
6
  """
7
  Prefix op by namespace.
8
  """
9
- return f"_relu_metal_86f75d9::{op_name}"
 
1
  import torch
2
+ from . import _relu_metal_c835f43
3
+ ops = torch.ops._relu_metal_c835f43
4
 
5
  def add_op_namespace_prefix(op_name: str):
6
  """
7
  Prefix op by namespace.
8
  """
9
+ return f"_relu_metal_c835f43::{op_name}"
build/torch211-metal-aarch64-darwin/{_relu_metal_86f75d9.abi3.so → _relu_metal_c835f43.abi3.so} RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:2df2d4f8ceaaea6a1f42787e509e25ab4f0653731ae1276a2b025179175c1739
3
  size 100920
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e14587decf73be5a68a2ee095c1320499d27fdaf9ade15fde47e1d7cd2c94f4b
3
  size 100920
build/torch211-metal-aarch64-darwin/metadata.json CHANGED
@@ -1,6 +1,6 @@
1
  {
2
  "name": "relu",
3
- "id": "_relu_metal_86f75d9",
4
  "version": 1,
5
  "license": "Apache-2.0",
6
  "python-depends": [],
 
1
  {
2
  "name": "relu",
3
+ "id": "_relu_metal_c835f43",
4
  "version": 1,
5
  "license": "Apache-2.0",
6
  "python-depends": [],
build/torch212-cpu-aarch64-darwin/__init__.py ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from typing import Optional
2
+
3
+ import torch
4
+
5
+ from ._ops import ops
6
+
7
+ from . import layers
8
+
9
+
10
+ def relu(x: torch.Tensor, out: Optional[torch.Tensor] = None) -> torch.Tensor:
11
+ if out is None:
12
+ out = torch.empty_like(x)
13
+ ops.relu(out, x)
14
+ return out
15
+
16
+ __all__ = ["relu", "layers"]
build/torch212-cpu-aarch64-darwin/_ops.py ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+ from . import _relu_cpu_c835f43
3
+ ops = torch.ops._relu_cpu_c835f43
4
+
5
+ def add_op_namespace_prefix(op_name: str):
6
+ """
7
+ Prefix op by namespace.
8
+ """
9
+ return f"_relu_cpu_c835f43::{op_name}"
build/torch212-cpu-aarch64-darwin/_relu_cpu_c835f43.abi3.so ADDED
Binary file (80.3 kB). View file
 
build/torch212-cpu-aarch64-darwin/layers/__init__.py ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+ import torch.nn as nn
3
+
4
+ from .._ops import ops
5
+
6
+
7
+ class ReLU(nn.Module):
8
+ def forward(self, x: torch.Tensor) -> torch.Tensor:
9
+ out = torch.empty_like(x)
10
+ ops.relu(out, x)
11
+ return out
build/torch212-cpu-aarch64-darwin/metadata.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "relu",
3
+ "id": "_relu_cpu_c835f43",
4
+ "version": 1,
5
+ "license": "Apache-2.0",
6
+ "python-depends": [],
7
+ "backend": {
8
+ "type": "cpu"
9
+ }
10
+ }
build/torch212-cpu-aarch64-darwin/relu/__init__.py ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import ctypes
2
+ import importlib.util
3
+ import sys
4
+ from pathlib import Path
5
+ from types import ModuleType
6
+
7
+
8
+ def _import_from_path(file_path: Path) -> ModuleType:
9
+ # We cannot use the module name as-is, after adding it to `sys.modules`,
10
+ # it would also be used for other imports. So, we make a module name that
11
+ # depends on the path for it to be unique using the hex-encoded hash of
12
+ # the path.
13
+ path_hash = "{:x}".format(ctypes.c_size_t(hash(file_path.absolute())).value)
14
+ module_name = path_hash
15
+ spec = importlib.util.spec_from_file_location(module_name, file_path)
16
+ if spec is None:
17
+ raise ImportError(f"Cannot load spec for {module_name} from {file_path}")
18
+ module = importlib.util.module_from_spec(spec)
19
+ if module is None:
20
+ raise ImportError(f"Cannot load module {module_name} from spec")
21
+ sys.modules[module_name] = module
22
+ spec.loader.exec_module(module) # type: ignore
23
+ return module
24
+
25
+
26
+ globals().update(vars(_import_from_path(Path(__file__).parent.parent / "__init__.py")))
build/torch212-metal-aarch64-darwin/__init__.py ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from typing import Optional
2
+
3
+ import torch
4
+
5
+ from ._ops import ops
6
+
7
+ from . import layers
8
+
9
+
10
+ def relu(x: torch.Tensor, out: Optional[torch.Tensor] = None) -> torch.Tensor:
11
+ if out is None:
12
+ out = torch.empty_like(x)
13
+ ops.relu(out, x)
14
+ return out
15
+
16
+ __all__ = ["relu", "layers"]
build/torch212-metal-aarch64-darwin/_ops.py ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+ from . import _relu_metal_c835f43
3
+ ops = torch.ops._relu_metal_c835f43
4
+
5
+ def add_op_namespace_prefix(op_name: str):
6
+ """
7
+ Prefix op by namespace.
8
+ """
9
+ return f"_relu_metal_c835f43::{op_name}"
build/torch212-metal-aarch64-darwin/_relu_metal_c835f43.abi3.so ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1bdf1c592c970d44404cfeef285d4e7ef1b4430486a9b44c40adacfa60bc10b9
3
+ size 100952
build/torch212-metal-aarch64-darwin/layers/__init__.py ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+ import torch.nn as nn
3
+
4
+ from .._ops import ops
5
+
6
+
7
+ class ReLU(nn.Module):
8
+ def forward(self, x: torch.Tensor) -> torch.Tensor:
9
+ out = torch.empty_like(x)
10
+ ops.relu(out, x)
11
+ return out
build/torch212-metal-aarch64-darwin/metadata.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "relu",
3
+ "id": "_relu_metal_c835f43",
4
+ "version": 1,
5
+ "license": "Apache-2.0",
6
+ "python-depends": [],
7
+ "backend": {
8
+ "type": "metal"
9
+ }
10
+ }
build/torch212-metal-aarch64-darwin/relu/__init__.py ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import ctypes
2
+ import importlib.util
3
+ import sys
4
+ from pathlib import Path
5
+ from types import ModuleType
6
+
7
+
8
+ def _import_from_path(file_path: Path) -> ModuleType:
9
+ # We cannot use the module name as-is, after adding it to `sys.modules`,
10
+ # it would also be used for other imports. So, we make a module name that
11
+ # depends on the path for it to be unique using the hex-encoded hash of
12
+ # the path.
13
+ path_hash = "{:x}".format(ctypes.c_size_t(hash(file_path.absolute())).value)
14
+ module_name = path_hash
15
+ spec = importlib.util.spec_from_file_location(module_name, file_path)
16
+ if spec is None:
17
+ raise ImportError(f"Cannot load spec for {module_name} from {file_path}")
18
+ module = importlib.util.module_from_spec(spec)
19
+ if module is None:
20
+ raise ImportError(f"Cannot load module {module_name} from spec")
21
+ sys.modules[module_name] = module
22
+ spec.loader.exec_module(module) # type: ignore
23
+ return module
24
+
25
+
26
+ globals().update(vars(_import_from_path(Path(__file__).parent.parent / "__init__.py")))