Kernels
danieldk HF Staff commited on
Commit
66360f6
·
verified ·
1 Parent(s): be00082

Build uploaded using `kernels`.

Browse files
.gitattributes CHANGED
@@ -211,3 +211,4 @@ build/torch29-cxx11-rocm63-x86_64-linux/_relu_ff7d195.abi3.so filter=lfs diff=lf
211
  build/torch29-cxx11-rocm64-x86_64-linux/_relu_ff7d195.abi3.so filter=lfs diff=lfs merge=lfs -text
212
  build/torch29-cxx11-xpu20252-x86_64-linux/_relu_ff7d195.abi3.so filter=lfs diff=lfs merge=lfs -text
213
  build/torch210-xpu20253-x86_64-windows/relu/_relu_d7b860a.pyd filter=lfs diff=lfs merge=lfs -text
 
 
211
  build/torch29-cxx11-rocm64-x86_64-linux/_relu_ff7d195.abi3.so filter=lfs diff=lfs merge=lfs -text
212
  build/torch29-cxx11-xpu20252-x86_64-linux/_relu_ff7d195.abi3.so filter=lfs diff=lfs merge=lfs -text
213
  build/torch210-xpu20253-x86_64-windows/relu/_relu_d7b860a.pyd filter=lfs diff=lfs merge=lfs -text
214
+ build/torch210-metal-aarch64-darwin/_relu_2b7ea88.abi3.so filter=lfs diff=lfs merge=lfs -text
build/torch210-cpu-aarch64-darwin/__init__.py ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from typing import Optional
2
+
3
+ import torch
4
+
5
+ from ._ops import ops
6
+
7
+
8
+ def relu(x: torch.Tensor, out: Optional[torch.Tensor] = None) -> torch.Tensor:
9
+ if out is None:
10
+ out = torch.empty_like(x)
11
+ ops.relu(out, x)
12
+ return out
build/torch210-cpu-aarch64-darwin/_ops.py ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+ from . import _relu_2b7ea88
3
+ ops = torch.ops._relu_2b7ea88
4
+
5
+ def add_op_namespace_prefix(op_name: str):
6
+ """
7
+ Prefix op by namespace.
8
+ """
9
+ return f"_relu_2b7ea88::{op_name}"
build/torch210-cpu-aarch64-darwin/_relu_2b7ea88.abi3.so ADDED
Binary file (80 kB). View file
 
build/torch210-cpu-aarch64-darwin/metadata.json ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ {
2
+ "version": 1,
3
+ "python-depends": []
4
+ }
build/torch210-cpu-aarch64-darwin/relu/__init__.py ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import ctypes
2
+ import sys
3
+
4
+ import importlib
5
+ from pathlib import Path
6
+ from types import ModuleType
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/torch210-metal-aarch64-darwin/_ops.py CHANGED
@@ -1,9 +1,9 @@
1
  import torch
2
- from . import _relu_ff7d195
3
- ops = torch.ops._relu_ff7d195
4
 
5
  def add_op_namespace_prefix(op_name: str):
6
  """
7
  Prefix op by namespace.
8
  """
9
- return f"_relu_ff7d195::{op_name}"
 
1
  import torch
2
+ from . import _relu_2b7ea88
3
+ ops = torch.ops._relu_2b7ea88
4
 
5
  def add_op_namespace_prefix(op_name: str):
6
  """
7
  Prefix op by namespace.
8
  """
9
+ return f"_relu_2b7ea88::{op_name}"
build/torch210-metal-aarch64-darwin/{_relu_ff7d195.abi3.so → _relu_2b7ea88.abi3.so} RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:f7043c3a657f31236f1d9e055008a6c683ab96be79aeabc800a363233d507f77
3
  size 100632
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e329f8b116d8f0e04ba517bf47055742b1a7ba8505df3c1960d93d873006c0bd
3
  size 100632
build/torch29-cpu-aarch64-darwin/__init__.py ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from typing import Optional
2
+
3
+ import torch
4
+
5
+ from ._ops import ops
6
+
7
+
8
+ def relu(x: torch.Tensor, out: Optional[torch.Tensor] = None) -> torch.Tensor:
9
+ if out is None:
10
+ out = torch.empty_like(x)
11
+ ops.relu(out, x)
12
+ return out
build/torch29-cpu-aarch64-darwin/_ops.py ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+ from . import _relu_2b7ea88
3
+ ops = torch.ops._relu_2b7ea88
4
+
5
+ def add_op_namespace_prefix(op_name: str):
6
+ """
7
+ Prefix op by namespace.
8
+ """
9
+ return f"_relu_2b7ea88::{op_name}"
build/torch29-cpu-aarch64-darwin/_relu_2b7ea88.abi3.so ADDED
Binary file (79.2 kB). View file
 
build/torch29-cpu-aarch64-darwin/metadata.json ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ {
2
+ "version": 1,
3
+ "python-depends": []
4
+ }
build/torch29-cpu-aarch64-darwin/relu/__init__.py ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import ctypes
2
+ import sys
3
+
4
+ import importlib
5
+ from pathlib import Path
6
+ from types import ModuleType
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/torch29-metal-aarch64-darwin/_ops.py CHANGED
@@ -1,9 +1,9 @@
1
  import torch
2
- from . import _relu_ff7d195
3
- ops = torch.ops._relu_ff7d195
4
 
5
  def add_op_namespace_prefix(op_name: str):
6
  """
7
  Prefix op by namespace.
8
  """
9
- return f"_relu_ff7d195::{op_name}"
 
1
  import torch
2
+ from . import _relu_2b7ea88
3
+ ops = torch.ops._relu_2b7ea88
4
 
5
  def add_op_namespace_prefix(op_name: str):
6
  """
7
  Prefix op by namespace.
8
  """
9
+ return f"_relu_2b7ea88::{op_name}"
build/torch29-metal-aarch64-darwin/{_relu_ff7d195.abi3.so → _relu_2b7ea88.abi3.so} RENAMED
Binary files a/build/torch29-metal-aarch64-darwin/_relu_ff7d195.abi3.so and b/build/torch29-metal-aarch64-darwin/_relu_2b7ea88.abi3.so differ