diff --git a/.gitattributes b/.gitattributes index b0c5b46c32c01830c7b40722e2177e8f2cc666dc..839f19d6a1fd522a2c88898e6094dbead0ef7744 100644 --- a/.gitattributes +++ b/.gitattributes @@ -71,3 +71,21 @@ build/torch29-cxx11-rocm64-x86_64-linux/relu/_relu_8d21eda.abi3.so filter=lfs di build/torch29-cxx11-xpu20252-x86_64-linux/relu/_relu_8d21eda.abi3.so filter=lfs diff=lfs merge=lfs -text build/torch29-cxx11-cu126-x86_64-linux/relu/_relu_e52ac39.abi3.so filter=lfs diff=lfs merge=lfs -text build/torch29-cxx11-cu126-x86_64-linux/relu/_relu_46e4283.abi3.so filter=lfs diff=lfs merge=lfs -text +build/torch210-cxx11-cu126-x86_64-linux/_relu_9f1f069.abi3.so filter=lfs diff=lfs merge=lfs -text +build/torch210-cxx11-cu128-x86_64-linux/_relu_9f1f069.abi3.so filter=lfs diff=lfs merge=lfs -text +build/torch210-cxx11-cu130-x86_64-linux/_relu_9f1f069.abi3.so filter=lfs diff=lfs merge=lfs -text +build/torch210-cxx11-rocm70-x86_64-linux/_relu_9f1f069.abi3.so filter=lfs diff=lfs merge=lfs -text +build/torch210-cxx11-rocm71-x86_64-linux/_relu_9f1f069.abi3.so filter=lfs diff=lfs merge=lfs -text +build/torch210-cxx11-xpu20253-x86_64-linux/_relu_9f1f069.abi3.so filter=lfs diff=lfs merge=lfs -text +build/torch28-cxx11-cu126-x86_64-linux/_relu_9f1f069.abi3.so filter=lfs diff=lfs merge=lfs -text +build/torch28-cxx11-cu128-x86_64-linux/_relu_9f1f069.abi3.so filter=lfs diff=lfs merge=lfs -text +build/torch28-cxx11-cu129-x86_64-linux/_relu_9f1f069.abi3.so filter=lfs diff=lfs merge=lfs -text +build/torch28-cxx11-rocm63-x86_64-linux/_relu_9f1f069.abi3.so filter=lfs diff=lfs merge=lfs -text +build/torch28-cxx11-rocm64-x86_64-linux/_relu_9f1f069.abi3.so filter=lfs diff=lfs merge=lfs -text +build/torch28-cxx11-xpu20251-x86_64-linux/_relu_9f1f069.abi3.so filter=lfs diff=lfs merge=lfs -text +build/torch29-cxx11-cu126-x86_64-linux/_relu_9f1f069.abi3.so filter=lfs diff=lfs merge=lfs -text +build/torch29-cxx11-cu128-x86_64-linux/_relu_9f1f069.abi3.so filter=lfs diff=lfs merge=lfs -text +build/torch29-cxx11-cu130-x86_64-linux/_relu_9f1f069.abi3.so filter=lfs diff=lfs merge=lfs -text +build/torch29-cxx11-rocm63-x86_64-linux/_relu_9f1f069.abi3.so filter=lfs diff=lfs merge=lfs -text +build/torch29-cxx11-rocm64-x86_64-linux/_relu_9f1f069.abi3.so filter=lfs diff=lfs merge=lfs -text +build/torch29-cxx11-xpu20252-x86_64-linux/_relu_9f1f069.abi3.so filter=lfs diff=lfs merge=lfs -text diff --git a/build/torch210-cxx11-cu126-x86_64-linux/__init__.py b/build/torch210-cxx11-cu126-x86_64-linux/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8050dfd765d1a50720e99d17870c2c854d9e2574 --- /dev/null +++ b/build/torch210-cxx11-cu126-x86_64-linux/__init__.py @@ -0,0 +1,12 @@ +from typing import Optional + +import torch + +from ._ops import ops + + +def relu(x: torch.Tensor, out: Optional[torch.Tensor] = None) -> torch.Tensor: + if out is None: + out = torch.empty_like(x) + ops.relu(out, x) + return out \ No newline at end of file diff --git a/build/torch28-cxx11-cu128-x86_64-linux/relu/_ops.py b/build/torch210-cxx11-cu126-x86_64-linux/_ops.py similarity index 51% rename from build/torch28-cxx11-cu128-x86_64-linux/relu/_ops.py rename to build/torch210-cxx11-cu126-x86_64-linux/_ops.py index c63e9f6664e3cecf51678298652a58dd53e9b0bf..2e5edf901b80e2f17196d66460df1c077e0491ac 100644 --- a/build/torch28-cxx11-cu128-x86_64-linux/relu/_ops.py +++ b/build/torch210-cxx11-cu126-x86_64-linux/_ops.py @@ -1,9 +1,9 @@ import torch -from . import _relu_8d21eda -ops = torch.ops._relu_8d21eda +from . import _relu_9f1f069 +ops = torch.ops._relu_9f1f069 def add_op_namespace_prefix(op_name: str): """ Prefix op by namespace. """ - return f"_relu_8d21eda::{op_name}" \ No newline at end of file + return f"_relu_9f1f069::{op_name}" \ No newline at end of file diff --git a/build/torch210-cxx11-cu126-x86_64-linux/_relu_9f1f069.abi3.so b/build/torch210-cxx11-cu126-x86_64-linux/_relu_9f1f069.abi3.so new file mode 100644 index 0000000000000000000000000000000000000000..4938cf01d4f35abd8c4bde198fbe9c090b5b7be2 --- /dev/null +++ b/build/torch210-cxx11-cu126-x86_64-linux/_relu_9f1f069.abi3.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4331a70e73fe4493c4a77e411ceb88fbdf91fe22988cf387ba888457bc95428a +size 2019872 diff --git a/build/torch210-cxx11-cu126-x86_64-linux/metadata.json b/build/torch210-cxx11-cu126-x86_64-linux/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..76bafa5f33b6818aa6bb4cab04be811b87519b44 --- /dev/null +++ b/build/torch210-cxx11-cu126-x86_64-linux/metadata.json @@ -0,0 +1 @@ +{"python-depends":[]} \ No newline at end of file diff --git a/build/torch210-cxx11-cu126-x86_64-linux/relu/__init__.py b/build/torch210-cxx11-cu126-x86_64-linux/relu/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..03dbc1afe1cf156661a2b1b22003cd5f599a0309 --- /dev/null +++ b/build/torch210-cxx11-cu126-x86_64-linux/relu/__init__.py @@ -0,0 +1,26 @@ +import ctypes +import sys + +import importlib +from pathlib import Path +from types import ModuleType + +def _import_from_path(file_path: Path) -> ModuleType: + # We cannot use the module name as-is, after adding it to `sys.modules`, + # it would also be used for other imports. So, we make a module name that + # depends on the path for it to be unique using the hex-encoded hash of + # the path. + path_hash = "{:x}".format(ctypes.c_size_t(hash(file_path.absolute())).value) + module_name = path_hash + spec = importlib.util.spec_from_file_location(module_name, file_path) + if spec is None: + raise ImportError(f"Cannot load spec for {module_name} from {file_path}") + module = importlib.util.module_from_spec(spec) + if module is None: + raise ImportError(f"Cannot load module {module_name} from spec") + sys.modules[module_name] = module + spec.loader.exec_module(module) # type: ignore + return module + + +globals().update(vars(_import_from_path(Path(__file__).parent.parent / "__init__.py"))) diff --git a/build/torch210-cxx11-cu128-x86_64-linux/__init__.py b/build/torch210-cxx11-cu128-x86_64-linux/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8050dfd765d1a50720e99d17870c2c854d9e2574 --- /dev/null +++ b/build/torch210-cxx11-cu128-x86_64-linux/__init__.py @@ -0,0 +1,12 @@ +from typing import Optional + +import torch + +from ._ops import ops + + +def relu(x: torch.Tensor, out: Optional[torch.Tensor] = None) -> torch.Tensor: + if out is None: + out = torch.empty_like(x) + ops.relu(out, x) + return out \ No newline at end of file diff --git a/build/torch28-cxx11-cu129-x86_64-linux/relu/_ops.py b/build/torch210-cxx11-cu128-x86_64-linux/_ops.py similarity index 51% rename from build/torch28-cxx11-cu129-x86_64-linux/relu/_ops.py rename to build/torch210-cxx11-cu128-x86_64-linux/_ops.py index c63e9f6664e3cecf51678298652a58dd53e9b0bf..2e5edf901b80e2f17196d66460df1c077e0491ac 100644 --- a/build/torch28-cxx11-cu129-x86_64-linux/relu/_ops.py +++ b/build/torch210-cxx11-cu128-x86_64-linux/_ops.py @@ -1,9 +1,9 @@ import torch -from . import _relu_8d21eda -ops = torch.ops._relu_8d21eda +from . import _relu_9f1f069 +ops = torch.ops._relu_9f1f069 def add_op_namespace_prefix(op_name: str): """ Prefix op by namespace. """ - return f"_relu_8d21eda::{op_name}" \ No newline at end of file + return f"_relu_9f1f069::{op_name}" \ No newline at end of file diff --git a/build/torch210-cxx11-cu128-x86_64-linux/_relu_9f1f069.abi3.so b/build/torch210-cxx11-cu128-x86_64-linux/_relu_9f1f069.abi3.so new file mode 100644 index 0000000000000000000000000000000000000000..bcfb9ba6a82fcc681bcf1933fff7af9d8a78cd15 --- /dev/null +++ b/build/torch210-cxx11-cu128-x86_64-linux/_relu_9f1f069.abi3.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fb9d4b04679a723ed97e12592f1c9977d3e858d896c527b0e99302de5dcbf00d +size 2111824 diff --git a/build/torch210-cxx11-cu128-x86_64-linux/metadata.json b/build/torch210-cxx11-cu128-x86_64-linux/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..76bafa5f33b6818aa6bb4cab04be811b87519b44 --- /dev/null +++ b/build/torch210-cxx11-cu128-x86_64-linux/metadata.json @@ -0,0 +1 @@ +{"python-depends":[]} \ No newline at end of file diff --git a/build/torch210-cxx11-cu128-x86_64-linux/relu/__init__.py b/build/torch210-cxx11-cu128-x86_64-linux/relu/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..03dbc1afe1cf156661a2b1b22003cd5f599a0309 --- /dev/null +++ b/build/torch210-cxx11-cu128-x86_64-linux/relu/__init__.py @@ -0,0 +1,26 @@ +import ctypes +import sys + +import importlib +from pathlib import Path +from types import ModuleType + +def _import_from_path(file_path: Path) -> ModuleType: + # We cannot use the module name as-is, after adding it to `sys.modules`, + # it would also be used for other imports. So, we make a module name that + # depends on the path for it to be unique using the hex-encoded hash of + # the path. + path_hash = "{:x}".format(ctypes.c_size_t(hash(file_path.absolute())).value) + module_name = path_hash + spec = importlib.util.spec_from_file_location(module_name, file_path) + if spec is None: + raise ImportError(f"Cannot load spec for {module_name} from {file_path}") + module = importlib.util.module_from_spec(spec) + if module is None: + raise ImportError(f"Cannot load module {module_name} from spec") + sys.modules[module_name] = module + spec.loader.exec_module(module) # type: ignore + return module + + +globals().update(vars(_import_from_path(Path(__file__).parent.parent / "__init__.py"))) diff --git a/build/torch210-cxx11-cu130-x86_64-linux/__init__.py b/build/torch210-cxx11-cu130-x86_64-linux/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8050dfd765d1a50720e99d17870c2c854d9e2574 --- /dev/null +++ b/build/torch210-cxx11-cu130-x86_64-linux/__init__.py @@ -0,0 +1,12 @@ +from typing import Optional + +import torch + +from ._ops import ops + + +def relu(x: torch.Tensor, out: Optional[torch.Tensor] = None) -> torch.Tensor: + if out is None: + out = torch.empty_like(x) + ops.relu(out, x) + return out \ No newline at end of file diff --git a/build/torch28-cxx11-cu126-x86_64-linux/relu/_ops.py b/build/torch210-cxx11-cu130-x86_64-linux/_ops.py similarity index 51% rename from build/torch28-cxx11-cu126-x86_64-linux/relu/_ops.py rename to build/torch210-cxx11-cu130-x86_64-linux/_ops.py index c63e9f6664e3cecf51678298652a58dd53e9b0bf..2e5edf901b80e2f17196d66460df1c077e0491ac 100644 --- a/build/torch28-cxx11-cu126-x86_64-linux/relu/_ops.py +++ b/build/torch210-cxx11-cu130-x86_64-linux/_ops.py @@ -1,9 +1,9 @@ import torch -from . import _relu_8d21eda -ops = torch.ops._relu_8d21eda +from . import _relu_9f1f069 +ops = torch.ops._relu_9f1f069 def add_op_namespace_prefix(op_name: str): """ Prefix op by namespace. """ - return f"_relu_8d21eda::{op_name}" \ No newline at end of file + return f"_relu_9f1f069::{op_name}" \ No newline at end of file diff --git a/build/torch210-cxx11-cu130-x86_64-linux/_relu_9f1f069.abi3.so b/build/torch210-cxx11-cu130-x86_64-linux/_relu_9f1f069.abi3.so new file mode 100644 index 0000000000000000000000000000000000000000..847cdd8ff6e3276bb336aa32756de59a80d35943 --- /dev/null +++ b/build/torch210-cxx11-cu130-x86_64-linux/_relu_9f1f069.abi3.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2983b028177a3807d423750a37ca685c7ebfc8100b5f6598df69667afe8f35ec +size 2129640 diff --git a/build/torch210-cxx11-cu130-x86_64-linux/metadata.json b/build/torch210-cxx11-cu130-x86_64-linux/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..76bafa5f33b6818aa6bb4cab04be811b87519b44 --- /dev/null +++ b/build/torch210-cxx11-cu130-x86_64-linux/metadata.json @@ -0,0 +1 @@ +{"python-depends":[]} \ No newline at end of file diff --git a/build/torch210-cxx11-cu130-x86_64-linux/relu/__init__.py b/build/torch210-cxx11-cu130-x86_64-linux/relu/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..03dbc1afe1cf156661a2b1b22003cd5f599a0309 --- /dev/null +++ b/build/torch210-cxx11-cu130-x86_64-linux/relu/__init__.py @@ -0,0 +1,26 @@ +import ctypes +import sys + +import importlib +from pathlib import Path +from types import ModuleType + +def _import_from_path(file_path: Path) -> ModuleType: + # We cannot use the module name as-is, after adding it to `sys.modules`, + # it would also be used for other imports. So, we make a module name that + # depends on the path for it to be unique using the hex-encoded hash of + # the path. + path_hash = "{:x}".format(ctypes.c_size_t(hash(file_path.absolute())).value) + module_name = path_hash + spec = importlib.util.spec_from_file_location(module_name, file_path) + if spec is None: + raise ImportError(f"Cannot load spec for {module_name} from {file_path}") + module = importlib.util.module_from_spec(spec) + if module is None: + raise ImportError(f"Cannot load module {module_name} from spec") + sys.modules[module_name] = module + spec.loader.exec_module(module) # type: ignore + return module + + +globals().update(vars(_import_from_path(Path(__file__).parent.parent / "__init__.py"))) diff --git a/build/torch210-cxx11-rocm70-x86_64-linux/__init__.py b/build/torch210-cxx11-rocm70-x86_64-linux/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8050dfd765d1a50720e99d17870c2c854d9e2574 --- /dev/null +++ b/build/torch210-cxx11-rocm70-x86_64-linux/__init__.py @@ -0,0 +1,12 @@ +from typing import Optional + +import torch + +from ._ops import ops + + +def relu(x: torch.Tensor, out: Optional[torch.Tensor] = None) -> torch.Tensor: + if out is None: + out = torch.empty_like(x) + ops.relu(out, x) + return out \ No newline at end of file diff --git a/build/torch28-cxx11-rocm63-x86_64-linux/relu/_ops.py b/build/torch210-cxx11-rocm70-x86_64-linux/_ops.py similarity index 51% rename from build/torch28-cxx11-rocm63-x86_64-linux/relu/_ops.py rename to build/torch210-cxx11-rocm70-x86_64-linux/_ops.py index c63e9f6664e3cecf51678298652a58dd53e9b0bf..2e5edf901b80e2f17196d66460df1c077e0491ac 100644 --- a/build/torch28-cxx11-rocm63-x86_64-linux/relu/_ops.py +++ b/build/torch210-cxx11-rocm70-x86_64-linux/_ops.py @@ -1,9 +1,9 @@ import torch -from . import _relu_8d21eda -ops = torch.ops._relu_8d21eda +from . import _relu_9f1f069 +ops = torch.ops._relu_9f1f069 def add_op_namespace_prefix(op_name: str): """ Prefix op by namespace. """ - return f"_relu_8d21eda::{op_name}" \ No newline at end of file + return f"_relu_9f1f069::{op_name}" \ No newline at end of file diff --git a/build/torch210-cxx11-rocm70-x86_64-linux/_relu_9f1f069.abi3.so b/build/torch210-cxx11-rocm70-x86_64-linux/_relu_9f1f069.abi3.so new file mode 100644 index 0000000000000000000000000000000000000000..945f4c9656a7d805beb984ae035885c080e38eb3 --- /dev/null +++ b/build/torch210-cxx11-rocm70-x86_64-linux/_relu_9f1f069.abi3.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d0ee62fbd93bbf70a5239bd94669ec10c5466bd871d225dd42d89f68055335c1 +size 1990320 diff --git a/build/torch210-cxx11-rocm70-x86_64-linux/metadata.json b/build/torch210-cxx11-rocm70-x86_64-linux/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..76bafa5f33b6818aa6bb4cab04be811b87519b44 --- /dev/null +++ b/build/torch210-cxx11-rocm70-x86_64-linux/metadata.json @@ -0,0 +1 @@ +{"python-depends":[]} \ No newline at end of file diff --git a/build/torch210-cxx11-rocm70-x86_64-linux/relu/__init__.py b/build/torch210-cxx11-rocm70-x86_64-linux/relu/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..03dbc1afe1cf156661a2b1b22003cd5f599a0309 --- /dev/null +++ b/build/torch210-cxx11-rocm70-x86_64-linux/relu/__init__.py @@ -0,0 +1,26 @@ +import ctypes +import sys + +import importlib +from pathlib import Path +from types import ModuleType + +def _import_from_path(file_path: Path) -> ModuleType: + # We cannot use the module name as-is, after adding it to `sys.modules`, + # it would also be used for other imports. So, we make a module name that + # depends on the path for it to be unique using the hex-encoded hash of + # the path. + path_hash = "{:x}".format(ctypes.c_size_t(hash(file_path.absolute())).value) + module_name = path_hash + spec = importlib.util.spec_from_file_location(module_name, file_path) + if spec is None: + raise ImportError(f"Cannot load spec for {module_name} from {file_path}") + module = importlib.util.module_from_spec(spec) + if module is None: + raise ImportError(f"Cannot load module {module_name} from spec") + sys.modules[module_name] = module + spec.loader.exec_module(module) # type: ignore + return module + + +globals().update(vars(_import_from_path(Path(__file__).parent.parent / "__init__.py"))) diff --git a/build/torch210-cxx11-rocm71-x86_64-linux/__init__.py b/build/torch210-cxx11-rocm71-x86_64-linux/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8050dfd765d1a50720e99d17870c2c854d9e2574 --- /dev/null +++ b/build/torch210-cxx11-rocm71-x86_64-linux/__init__.py @@ -0,0 +1,12 @@ +from typing import Optional + +import torch + +from ._ops import ops + + +def relu(x: torch.Tensor, out: Optional[torch.Tensor] = None) -> torch.Tensor: + if out is None: + out = torch.empty_like(x) + ops.relu(out, x) + return out \ No newline at end of file diff --git a/build/torch210-cxx11-rocm71-x86_64-linux/_ops.py b/build/torch210-cxx11-rocm71-x86_64-linux/_ops.py new file mode 100644 index 0000000000000000000000000000000000000000..2e5edf901b80e2f17196d66460df1c077e0491ac --- /dev/null +++ b/build/torch210-cxx11-rocm71-x86_64-linux/_ops.py @@ -0,0 +1,9 @@ +import torch +from . import _relu_9f1f069 +ops = torch.ops._relu_9f1f069 + +def add_op_namespace_prefix(op_name: str): + """ + Prefix op by namespace. + """ + return f"_relu_9f1f069::{op_name}" \ No newline at end of file diff --git a/build/torch210-cxx11-rocm71-x86_64-linux/_relu_9f1f069.abi3.so b/build/torch210-cxx11-rocm71-x86_64-linux/_relu_9f1f069.abi3.so new file mode 100644 index 0000000000000000000000000000000000000000..a6e6a213854673b3049c7ce78dd537f41ced4591 --- /dev/null +++ b/build/torch210-cxx11-rocm71-x86_64-linux/_relu_9f1f069.abi3.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:87f0d86aeedffc637b070645822e6688be5744263c5fda3d0f92c4a827d8a37b +size 1990224 diff --git a/build/torch210-cxx11-rocm71-x86_64-linux/metadata.json b/build/torch210-cxx11-rocm71-x86_64-linux/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..76bafa5f33b6818aa6bb4cab04be811b87519b44 --- /dev/null +++ b/build/torch210-cxx11-rocm71-x86_64-linux/metadata.json @@ -0,0 +1 @@ +{"python-depends":[]} \ No newline at end of file diff --git a/build/torch210-cxx11-rocm71-x86_64-linux/relu/__init__.py b/build/torch210-cxx11-rocm71-x86_64-linux/relu/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..03dbc1afe1cf156661a2b1b22003cd5f599a0309 --- /dev/null +++ b/build/torch210-cxx11-rocm71-x86_64-linux/relu/__init__.py @@ -0,0 +1,26 @@ +import ctypes +import sys + +import importlib +from pathlib import Path +from types import ModuleType + +def _import_from_path(file_path: Path) -> ModuleType: + # We cannot use the module name as-is, after adding it to `sys.modules`, + # it would also be used for other imports. So, we make a module name that + # depends on the path for it to be unique using the hex-encoded hash of + # the path. + path_hash = "{:x}".format(ctypes.c_size_t(hash(file_path.absolute())).value) + module_name = path_hash + spec = importlib.util.spec_from_file_location(module_name, file_path) + if spec is None: + raise ImportError(f"Cannot load spec for {module_name} from {file_path}") + module = importlib.util.module_from_spec(spec) + if module is None: + raise ImportError(f"Cannot load module {module_name} from spec") + sys.modules[module_name] = module + spec.loader.exec_module(module) # type: ignore + return module + + +globals().update(vars(_import_from_path(Path(__file__).parent.parent / "__init__.py"))) diff --git a/build/torch210-cxx11-xpu20253-x86_64-linux/__init__.py b/build/torch210-cxx11-xpu20253-x86_64-linux/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8050dfd765d1a50720e99d17870c2c854d9e2574 --- /dev/null +++ b/build/torch210-cxx11-xpu20253-x86_64-linux/__init__.py @@ -0,0 +1,12 @@ +from typing import Optional + +import torch + +from ._ops import ops + + +def relu(x: torch.Tensor, out: Optional[torch.Tensor] = None) -> torch.Tensor: + if out is None: + out = torch.empty_like(x) + ops.relu(out, x) + return out \ No newline at end of file diff --git a/build/torch210-cxx11-xpu20253-x86_64-linux/_ops.py b/build/torch210-cxx11-xpu20253-x86_64-linux/_ops.py new file mode 100644 index 0000000000000000000000000000000000000000..2e5edf901b80e2f17196d66460df1c077e0491ac --- /dev/null +++ b/build/torch210-cxx11-xpu20253-x86_64-linux/_ops.py @@ -0,0 +1,9 @@ +import torch +from . import _relu_9f1f069 +ops = torch.ops._relu_9f1f069 + +def add_op_namespace_prefix(op_name: str): + """ + Prefix op by namespace. + """ + return f"_relu_9f1f069::{op_name}" \ No newline at end of file diff --git a/build/torch210-cxx11-xpu20253-x86_64-linux/_relu_9f1f069.abi3.so b/build/torch210-cxx11-xpu20253-x86_64-linux/_relu_9f1f069.abi3.so new file mode 100644 index 0000000000000000000000000000000000000000..34acfa59082fae91f396406494aee92d9cb55d70 --- /dev/null +++ b/build/torch210-cxx11-xpu20253-x86_64-linux/_relu_9f1f069.abi3.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3b8050743b1530ad911c74eef35ec5ffb76c2dda91790c56e083635d49aca10e +size 2050440 diff --git a/build/torch210-cxx11-xpu20253-x86_64-linux/metadata.json b/build/torch210-cxx11-xpu20253-x86_64-linux/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..76bafa5f33b6818aa6bb4cab04be811b87519b44 --- /dev/null +++ b/build/torch210-cxx11-xpu20253-x86_64-linux/metadata.json @@ -0,0 +1 @@ +{"python-depends":[]} \ No newline at end of file diff --git a/build/torch210-cxx11-xpu20253-x86_64-linux/relu/__init__.py b/build/torch210-cxx11-xpu20253-x86_64-linux/relu/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..03dbc1afe1cf156661a2b1b22003cd5f599a0309 --- /dev/null +++ b/build/torch210-cxx11-xpu20253-x86_64-linux/relu/__init__.py @@ -0,0 +1,26 @@ +import ctypes +import sys + +import importlib +from pathlib import Path +from types import ModuleType + +def _import_from_path(file_path: Path) -> ModuleType: + # We cannot use the module name as-is, after adding it to `sys.modules`, + # it would also be used for other imports. So, we make a module name that + # depends on the path for it to be unique using the hex-encoded hash of + # the path. + path_hash = "{:x}".format(ctypes.c_size_t(hash(file_path.absolute())).value) + module_name = path_hash + spec = importlib.util.spec_from_file_location(module_name, file_path) + if spec is None: + raise ImportError(f"Cannot load spec for {module_name} from {file_path}") + module = importlib.util.module_from_spec(spec) + if module is None: + raise ImportError(f"Cannot load module {module_name} from spec") + sys.modules[module_name] = module + spec.loader.exec_module(module) # type: ignore + return module + + +globals().update(vars(_import_from_path(Path(__file__).parent.parent / "__init__.py"))) diff --git a/build/torch28-cxx11-cu126-x86_64-linux/__init__.py b/build/torch28-cxx11-cu126-x86_64-linux/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8050dfd765d1a50720e99d17870c2c854d9e2574 --- /dev/null +++ b/build/torch28-cxx11-cu126-x86_64-linux/__init__.py @@ -0,0 +1,12 @@ +from typing import Optional + +import torch + +from ._ops import ops + + +def relu(x: torch.Tensor, out: Optional[torch.Tensor] = None) -> torch.Tensor: + if out is None: + out = torch.empty_like(x) + ops.relu(out, x) + return out \ No newline at end of file diff --git a/build/torch28-cxx11-cu126-x86_64-linux/_ops.py b/build/torch28-cxx11-cu126-x86_64-linux/_ops.py new file mode 100644 index 0000000000000000000000000000000000000000..2e5edf901b80e2f17196d66460df1c077e0491ac --- /dev/null +++ b/build/torch28-cxx11-cu126-x86_64-linux/_ops.py @@ -0,0 +1,9 @@ +import torch +from . import _relu_9f1f069 +ops = torch.ops._relu_9f1f069 + +def add_op_namespace_prefix(op_name: str): + """ + Prefix op by namespace. + """ + return f"_relu_9f1f069::{op_name}" \ No newline at end of file diff --git a/build/torch28-cxx11-cu126-x86_64-linux/_relu_9f1f069.abi3.so b/build/torch28-cxx11-cu126-x86_64-linux/_relu_9f1f069.abi3.so new file mode 100644 index 0000000000000000000000000000000000000000..7e95ed652184da6136e07c58e249912e9ea65c43 --- /dev/null +++ b/build/torch28-cxx11-cu126-x86_64-linux/_relu_9f1f069.abi3.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7ce61ae869ce8392e5ffcbf234b073368eed20808fedcf7236fa10690133d5a2 +size 2013928 diff --git a/build/torch28-cxx11-cu126-x86_64-linux/metadata.json b/build/torch28-cxx11-cu126-x86_64-linux/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..76bafa5f33b6818aa6bb4cab04be811b87519b44 --- /dev/null +++ b/build/torch28-cxx11-cu126-x86_64-linux/metadata.json @@ -0,0 +1 @@ +{"python-depends":[]} \ No newline at end of file diff --git a/build/torch28-cxx11-cu126-x86_64-linux/relu/__init__.py b/build/torch28-cxx11-cu126-x86_64-linux/relu/__init__.py index 8050dfd765d1a50720e99d17870c2c854d9e2574..03dbc1afe1cf156661a2b1b22003cd5f599a0309 100644 --- a/build/torch28-cxx11-cu126-x86_64-linux/relu/__init__.py +++ b/build/torch28-cxx11-cu126-x86_64-linux/relu/__init__.py @@ -1,12 +1,26 @@ -from typing import Optional +import ctypes +import sys -import torch +import importlib +from pathlib import Path +from types import ModuleType -from ._ops import ops +def _import_from_path(file_path: Path) -> ModuleType: + # We cannot use the module name as-is, after adding it to `sys.modules`, + # it would also be used for other imports. So, we make a module name that + # depends on the path for it to be unique using the hex-encoded hash of + # the path. + path_hash = "{:x}".format(ctypes.c_size_t(hash(file_path.absolute())).value) + module_name = path_hash + spec = importlib.util.spec_from_file_location(module_name, file_path) + if spec is None: + raise ImportError(f"Cannot load spec for {module_name} from {file_path}") + module = importlib.util.module_from_spec(spec) + if module is None: + raise ImportError(f"Cannot load module {module_name} from spec") + sys.modules[module_name] = module + spec.loader.exec_module(module) # type: ignore + return module -def relu(x: torch.Tensor, out: Optional[torch.Tensor] = None) -> torch.Tensor: - if out is None: - out = torch.empty_like(x) - ops.relu(out, x) - return out \ No newline at end of file +globals().update(vars(_import_from_path(Path(__file__).parent.parent / "__init__.py"))) diff --git a/build/torch28-cxx11-cu126-x86_64-linux/relu/__pycache__/__init__.cpython-313.pyc b/build/torch28-cxx11-cu126-x86_64-linux/relu/__pycache__/__init__.cpython-313.pyc deleted file mode 100644 index b2278c8e1f606bb4ae2caa2ae84c3b5745ad7368..0000000000000000000000000000000000000000 Binary files a/build/torch28-cxx11-cu126-x86_64-linux/relu/__pycache__/__init__.cpython-313.pyc and /dev/null differ diff --git a/build/torch28-cxx11-cu126-x86_64-linux/relu/__pycache__/_ops.cpython-313.pyc b/build/torch28-cxx11-cu126-x86_64-linux/relu/__pycache__/_ops.cpython-313.pyc deleted file mode 100644 index 811ee091a5b1c7a51e7f92225637b3bebf0f0c18..0000000000000000000000000000000000000000 Binary files a/build/torch28-cxx11-cu126-x86_64-linux/relu/__pycache__/_ops.cpython-313.pyc and /dev/null differ diff --git a/build/torch28-cxx11-cu126-x86_64-linux/relu/_relu_8d21eda.abi3.so b/build/torch28-cxx11-cu126-x86_64-linux/relu/_relu_8d21eda.abi3.so deleted file mode 100644 index 4fbc216c21a347932dfef895cf94cad382ebd618..0000000000000000000000000000000000000000 --- a/build/torch28-cxx11-cu126-x86_64-linux/relu/_relu_8d21eda.abi3.so +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6d68451cf8bb6093b27ea38431c5b9e813adaebc8abc7ea55e1e0f1e6237c596 -size 1988376 diff --git a/build/torch28-cxx11-cu128-x86_64-linux/__init__.py b/build/torch28-cxx11-cu128-x86_64-linux/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8050dfd765d1a50720e99d17870c2c854d9e2574 --- /dev/null +++ b/build/torch28-cxx11-cu128-x86_64-linux/__init__.py @@ -0,0 +1,12 @@ +from typing import Optional + +import torch + +from ._ops import ops + + +def relu(x: torch.Tensor, out: Optional[torch.Tensor] = None) -> torch.Tensor: + if out is None: + out = torch.empty_like(x) + ops.relu(out, x) + return out \ No newline at end of file diff --git a/build/torch28-cxx11-cu128-x86_64-linux/_ops.py b/build/torch28-cxx11-cu128-x86_64-linux/_ops.py new file mode 100644 index 0000000000000000000000000000000000000000..2e5edf901b80e2f17196d66460df1c077e0491ac --- /dev/null +++ b/build/torch28-cxx11-cu128-x86_64-linux/_ops.py @@ -0,0 +1,9 @@ +import torch +from . import _relu_9f1f069 +ops = torch.ops._relu_9f1f069 + +def add_op_namespace_prefix(op_name: str): + """ + Prefix op by namespace. + """ + return f"_relu_9f1f069::{op_name}" \ No newline at end of file diff --git a/build/torch28-cxx11-cu128-x86_64-linux/_relu_9f1f069.abi3.so b/build/torch28-cxx11-cu128-x86_64-linux/_relu_9f1f069.abi3.so new file mode 100644 index 0000000000000000000000000000000000000000..cbfafde4dd46a2085f80e351ab2c5deba50b338c --- /dev/null +++ b/build/torch28-cxx11-cu128-x86_64-linux/_relu_9f1f069.abi3.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f53b59d3863275f40114ae9d415e8dfbd1af68ea11bd924ed60088e76467a645 +size 2101656 diff --git a/build/torch28-cxx11-cu128-x86_64-linux/metadata.json b/build/torch28-cxx11-cu128-x86_64-linux/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..76bafa5f33b6818aa6bb4cab04be811b87519b44 --- /dev/null +++ b/build/torch28-cxx11-cu128-x86_64-linux/metadata.json @@ -0,0 +1 @@ +{"python-depends":[]} \ No newline at end of file diff --git a/build/torch28-cxx11-cu128-x86_64-linux/relu/__init__.py b/build/torch28-cxx11-cu128-x86_64-linux/relu/__init__.py index 8050dfd765d1a50720e99d17870c2c854d9e2574..03dbc1afe1cf156661a2b1b22003cd5f599a0309 100644 --- a/build/torch28-cxx11-cu128-x86_64-linux/relu/__init__.py +++ b/build/torch28-cxx11-cu128-x86_64-linux/relu/__init__.py @@ -1,12 +1,26 @@ -from typing import Optional +import ctypes +import sys -import torch +import importlib +from pathlib import Path +from types import ModuleType -from ._ops import ops +def _import_from_path(file_path: Path) -> ModuleType: + # We cannot use the module name as-is, after adding it to `sys.modules`, + # it would also be used for other imports. So, we make a module name that + # depends on the path for it to be unique using the hex-encoded hash of + # the path. + path_hash = "{:x}".format(ctypes.c_size_t(hash(file_path.absolute())).value) + module_name = path_hash + spec = importlib.util.spec_from_file_location(module_name, file_path) + if spec is None: + raise ImportError(f"Cannot load spec for {module_name} from {file_path}") + module = importlib.util.module_from_spec(spec) + if module is None: + raise ImportError(f"Cannot load module {module_name} from spec") + sys.modules[module_name] = module + spec.loader.exec_module(module) # type: ignore + return module -def relu(x: torch.Tensor, out: Optional[torch.Tensor] = None) -> torch.Tensor: - if out is None: - out = torch.empty_like(x) - ops.relu(out, x) - return out \ No newline at end of file +globals().update(vars(_import_from_path(Path(__file__).parent.parent / "__init__.py"))) diff --git a/build/torch28-cxx11-cu128-x86_64-linux/relu/__pycache__/__init__.cpython-313.pyc b/build/torch28-cxx11-cu128-x86_64-linux/relu/__pycache__/__init__.cpython-313.pyc deleted file mode 100644 index ba7a454fcf3c018d3ff60f2948fa44bac56c5504..0000000000000000000000000000000000000000 Binary files a/build/torch28-cxx11-cu128-x86_64-linux/relu/__pycache__/__init__.cpython-313.pyc and /dev/null differ diff --git a/build/torch28-cxx11-cu128-x86_64-linux/relu/__pycache__/_ops.cpython-313.pyc b/build/torch28-cxx11-cu128-x86_64-linux/relu/__pycache__/_ops.cpython-313.pyc deleted file mode 100644 index 04aea1f337d69e47ff5d08141acbdfbcd92c16fe..0000000000000000000000000000000000000000 Binary files a/build/torch28-cxx11-cu128-x86_64-linux/relu/__pycache__/_ops.cpython-313.pyc and /dev/null differ diff --git a/build/torch28-cxx11-cu128-x86_64-linux/relu/_relu_8d21eda.abi3.so b/build/torch28-cxx11-cu128-x86_64-linux/relu/_relu_8d21eda.abi3.so deleted file mode 100644 index b5cab8bd67b3585b0db72a518e0fb4670bf6235d..0000000000000000000000000000000000000000 --- a/build/torch28-cxx11-cu128-x86_64-linux/relu/_relu_8d21eda.abi3.so +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ae72c97d7cff191876d208ff87f7ff8a6c5154f6f739ca8f1eca3662e16e7761 -size 2059696 diff --git a/build/torch28-cxx11-cu129-x86_64-linux/__init__.py b/build/torch28-cxx11-cu129-x86_64-linux/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8050dfd765d1a50720e99d17870c2c854d9e2574 --- /dev/null +++ b/build/torch28-cxx11-cu129-x86_64-linux/__init__.py @@ -0,0 +1,12 @@ +from typing import Optional + +import torch + +from ._ops import ops + + +def relu(x: torch.Tensor, out: Optional[torch.Tensor] = None) -> torch.Tensor: + if out is None: + out = torch.empty_like(x) + ops.relu(out, x) + return out \ No newline at end of file diff --git a/build/torch28-cxx11-cu129-x86_64-linux/_ops.py b/build/torch28-cxx11-cu129-x86_64-linux/_ops.py new file mode 100644 index 0000000000000000000000000000000000000000..2e5edf901b80e2f17196d66460df1c077e0491ac --- /dev/null +++ b/build/torch28-cxx11-cu129-x86_64-linux/_ops.py @@ -0,0 +1,9 @@ +import torch +from . import _relu_9f1f069 +ops = torch.ops._relu_9f1f069 + +def add_op_namespace_prefix(op_name: str): + """ + Prefix op by namespace. + """ + return f"_relu_9f1f069::{op_name}" \ No newline at end of file diff --git a/build/torch28-cxx11-cu129-x86_64-linux/_relu_9f1f069.abi3.so b/build/torch28-cxx11-cu129-x86_64-linux/_relu_9f1f069.abi3.so new file mode 100644 index 0000000000000000000000000000000000000000..c7da8370f256f34e08475735d75059eee92eee55 --- /dev/null +++ b/build/torch28-cxx11-cu129-x86_64-linux/_relu_9f1f069.abi3.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c4cb02e5b63c1236dbbfc491dc79ac88da1172389f8402f23cbe76e76f1dd0a0 +size 2135440 diff --git a/build/torch28-cxx11-cu129-x86_64-linux/metadata.json b/build/torch28-cxx11-cu129-x86_64-linux/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..76bafa5f33b6818aa6bb4cab04be811b87519b44 --- /dev/null +++ b/build/torch28-cxx11-cu129-x86_64-linux/metadata.json @@ -0,0 +1 @@ +{"python-depends":[]} \ No newline at end of file diff --git a/build/torch28-cxx11-cu129-x86_64-linux/relu/__init__.py b/build/torch28-cxx11-cu129-x86_64-linux/relu/__init__.py index 8050dfd765d1a50720e99d17870c2c854d9e2574..03dbc1afe1cf156661a2b1b22003cd5f599a0309 100644 --- a/build/torch28-cxx11-cu129-x86_64-linux/relu/__init__.py +++ b/build/torch28-cxx11-cu129-x86_64-linux/relu/__init__.py @@ -1,12 +1,26 @@ -from typing import Optional +import ctypes +import sys -import torch +import importlib +from pathlib import Path +from types import ModuleType -from ._ops import ops +def _import_from_path(file_path: Path) -> ModuleType: + # We cannot use the module name as-is, after adding it to `sys.modules`, + # it would also be used for other imports. So, we make a module name that + # depends on the path for it to be unique using the hex-encoded hash of + # the path. + path_hash = "{:x}".format(ctypes.c_size_t(hash(file_path.absolute())).value) + module_name = path_hash + spec = importlib.util.spec_from_file_location(module_name, file_path) + if spec is None: + raise ImportError(f"Cannot load spec for {module_name} from {file_path}") + module = importlib.util.module_from_spec(spec) + if module is None: + raise ImportError(f"Cannot load module {module_name} from spec") + sys.modules[module_name] = module + spec.loader.exec_module(module) # type: ignore + return module -def relu(x: torch.Tensor, out: Optional[torch.Tensor] = None) -> torch.Tensor: - if out is None: - out = torch.empty_like(x) - ops.relu(out, x) - return out \ No newline at end of file +globals().update(vars(_import_from_path(Path(__file__).parent.parent / "__init__.py"))) diff --git a/build/torch28-cxx11-cu129-x86_64-linux/relu/__pycache__/__init__.cpython-313.pyc b/build/torch28-cxx11-cu129-x86_64-linux/relu/__pycache__/__init__.cpython-313.pyc deleted file mode 100644 index 3f0eb5238946ee63c4c6a479a42fb11d09222bdc..0000000000000000000000000000000000000000 Binary files a/build/torch28-cxx11-cu129-x86_64-linux/relu/__pycache__/__init__.cpython-313.pyc and /dev/null differ diff --git a/build/torch28-cxx11-cu129-x86_64-linux/relu/__pycache__/_ops.cpython-313.pyc b/build/torch28-cxx11-cu129-x86_64-linux/relu/__pycache__/_ops.cpython-313.pyc deleted file mode 100644 index 0c65a67971093dfab7af4f42f2c6433574dc938f..0000000000000000000000000000000000000000 Binary files a/build/torch28-cxx11-cu129-x86_64-linux/relu/__pycache__/_ops.cpython-313.pyc and /dev/null differ diff --git a/build/torch28-cxx11-cu129-x86_64-linux/relu/_relu_8d21eda.abi3.so b/build/torch28-cxx11-cu129-x86_64-linux/relu/_relu_8d21eda.abi3.so deleted file mode 100644 index eeb8139c2e2e359df0e94b183b9156760e9132ec..0000000000000000000000000000000000000000 --- a/build/torch28-cxx11-cu129-x86_64-linux/relu/_relu_8d21eda.abi3.so +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b5d87c3a0cc93a8c9ede0229c6596574bee39975950d2f5d39314ae80119a61f -size 2085288 diff --git a/build/torch28-cxx11-rocm63-x86_64-linux/__init__.py b/build/torch28-cxx11-rocm63-x86_64-linux/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8050dfd765d1a50720e99d17870c2c854d9e2574 --- /dev/null +++ b/build/torch28-cxx11-rocm63-x86_64-linux/__init__.py @@ -0,0 +1,12 @@ +from typing import Optional + +import torch + +from ._ops import ops + + +def relu(x: torch.Tensor, out: Optional[torch.Tensor] = None) -> torch.Tensor: + if out is None: + out = torch.empty_like(x) + ops.relu(out, x) + return out \ No newline at end of file diff --git a/build/torch28-cxx11-rocm63-x86_64-linux/_ops.py b/build/torch28-cxx11-rocm63-x86_64-linux/_ops.py new file mode 100644 index 0000000000000000000000000000000000000000..2e5edf901b80e2f17196d66460df1c077e0491ac --- /dev/null +++ b/build/torch28-cxx11-rocm63-x86_64-linux/_ops.py @@ -0,0 +1,9 @@ +import torch +from . import _relu_9f1f069 +ops = torch.ops._relu_9f1f069 + +def add_op_namespace_prefix(op_name: str): + """ + Prefix op by namespace. + """ + return f"_relu_9f1f069::{op_name}" \ No newline at end of file diff --git a/build/torch28-cxx11-rocm63-x86_64-linux/_relu_9f1f069.abi3.so b/build/torch28-cxx11-rocm63-x86_64-linux/_relu_9f1f069.abi3.so new file mode 100644 index 0000000000000000000000000000000000000000..f6749cbda5edabb1dd8e590103f8aa5003722327 --- /dev/null +++ b/build/torch28-cxx11-rocm63-x86_64-linux/_relu_9f1f069.abi3.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fc1207b128f1d74a74c0dc454c74c20894a2b80568b6abec71b12effc660f95f +size 1970264 diff --git a/build/torch28-cxx11-rocm63-x86_64-linux/metadata.json b/build/torch28-cxx11-rocm63-x86_64-linux/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..76bafa5f33b6818aa6bb4cab04be811b87519b44 --- /dev/null +++ b/build/torch28-cxx11-rocm63-x86_64-linux/metadata.json @@ -0,0 +1 @@ +{"python-depends":[]} \ No newline at end of file diff --git a/build/torch28-cxx11-rocm63-x86_64-linux/relu/__init__.py b/build/torch28-cxx11-rocm63-x86_64-linux/relu/__init__.py index 8050dfd765d1a50720e99d17870c2c854d9e2574..03dbc1afe1cf156661a2b1b22003cd5f599a0309 100644 --- a/build/torch28-cxx11-rocm63-x86_64-linux/relu/__init__.py +++ b/build/torch28-cxx11-rocm63-x86_64-linux/relu/__init__.py @@ -1,12 +1,26 @@ -from typing import Optional +import ctypes +import sys -import torch +import importlib +from pathlib import Path +from types import ModuleType -from ._ops import ops +def _import_from_path(file_path: Path) -> ModuleType: + # We cannot use the module name as-is, after adding it to `sys.modules`, + # it would also be used for other imports. So, we make a module name that + # depends on the path for it to be unique using the hex-encoded hash of + # the path. + path_hash = "{:x}".format(ctypes.c_size_t(hash(file_path.absolute())).value) + module_name = path_hash + spec = importlib.util.spec_from_file_location(module_name, file_path) + if spec is None: + raise ImportError(f"Cannot load spec for {module_name} from {file_path}") + module = importlib.util.module_from_spec(spec) + if module is None: + raise ImportError(f"Cannot load module {module_name} from spec") + sys.modules[module_name] = module + spec.loader.exec_module(module) # type: ignore + return module -def relu(x: torch.Tensor, out: Optional[torch.Tensor] = None) -> torch.Tensor: - if out is None: - out = torch.empty_like(x) - ops.relu(out, x) - return out \ No newline at end of file +globals().update(vars(_import_from_path(Path(__file__).parent.parent / "__init__.py"))) diff --git a/build/torch28-cxx11-rocm63-x86_64-linux/relu/__pycache__/__init__.cpython-313.pyc b/build/torch28-cxx11-rocm63-x86_64-linux/relu/__pycache__/__init__.cpython-313.pyc deleted file mode 100644 index 6d43e2903b98d1026609c41fffa2ecea9b30ed7c..0000000000000000000000000000000000000000 Binary files a/build/torch28-cxx11-rocm63-x86_64-linux/relu/__pycache__/__init__.cpython-313.pyc and /dev/null differ diff --git a/build/torch28-cxx11-rocm63-x86_64-linux/relu/__pycache__/_ops.cpython-313.pyc b/build/torch28-cxx11-rocm63-x86_64-linux/relu/__pycache__/_ops.cpython-313.pyc deleted file mode 100644 index 8ca197af6109e77d3c0a19e204997596d672bd7a..0000000000000000000000000000000000000000 Binary files a/build/torch28-cxx11-rocm63-x86_64-linux/relu/__pycache__/_ops.cpython-313.pyc and /dev/null differ diff --git a/build/torch28-cxx11-rocm63-x86_64-linux/relu/_relu_8d21eda.abi3.so b/build/torch28-cxx11-rocm63-x86_64-linux/relu/_relu_8d21eda.abi3.so deleted file mode 100644 index cb0095008b68a1842b860db63832be8a8614d807..0000000000000000000000000000000000000000 --- a/build/torch28-cxx11-rocm63-x86_64-linux/relu/_relu_8d21eda.abi3.so +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3bd5a2bd6e893cf17d1b9da83381eae186779f7d65c0e8a2a71ea66604137897 -size 1956296 diff --git a/build/torch28-cxx11-rocm64-x86_64-linux/__init__.py b/build/torch28-cxx11-rocm64-x86_64-linux/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8050dfd765d1a50720e99d17870c2c854d9e2574 --- /dev/null +++ b/build/torch28-cxx11-rocm64-x86_64-linux/__init__.py @@ -0,0 +1,12 @@ +from typing import Optional + +import torch + +from ._ops import ops + + +def relu(x: torch.Tensor, out: Optional[torch.Tensor] = None) -> torch.Tensor: + if out is None: + out = torch.empty_like(x) + ops.relu(out, x) + return out \ No newline at end of file diff --git a/build/torch28-cxx11-rocm64-x86_64-linux/_ops.py b/build/torch28-cxx11-rocm64-x86_64-linux/_ops.py new file mode 100644 index 0000000000000000000000000000000000000000..2e5edf901b80e2f17196d66460df1c077e0491ac --- /dev/null +++ b/build/torch28-cxx11-rocm64-x86_64-linux/_ops.py @@ -0,0 +1,9 @@ +import torch +from . import _relu_9f1f069 +ops = torch.ops._relu_9f1f069 + +def add_op_namespace_prefix(op_name: str): + """ + Prefix op by namespace. + """ + return f"_relu_9f1f069::{op_name}" \ No newline at end of file diff --git a/build/torch28-cxx11-rocm64-x86_64-linux/_relu_9f1f069.abi3.so b/build/torch28-cxx11-rocm64-x86_64-linux/_relu_9f1f069.abi3.so new file mode 100644 index 0000000000000000000000000000000000000000..36567e023c3721b4eab8f9cd52aba40ffa804952 --- /dev/null +++ b/build/torch28-cxx11-rocm64-x86_64-linux/_relu_9f1f069.abi3.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4ac4301301b2a1bd30317797d6deb03c3797b822f377e320192263c9297f8b87 +size 1984936 diff --git a/build/torch28-cxx11-rocm64-x86_64-linux/metadata.json b/build/torch28-cxx11-rocm64-x86_64-linux/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..76bafa5f33b6818aa6bb4cab04be811b87519b44 --- /dev/null +++ b/build/torch28-cxx11-rocm64-x86_64-linux/metadata.json @@ -0,0 +1 @@ +{"python-depends":[]} \ No newline at end of file diff --git a/build/torch28-cxx11-rocm64-x86_64-linux/relu/__init__.py b/build/torch28-cxx11-rocm64-x86_64-linux/relu/__init__.py index 8050dfd765d1a50720e99d17870c2c854d9e2574..03dbc1afe1cf156661a2b1b22003cd5f599a0309 100644 --- a/build/torch28-cxx11-rocm64-x86_64-linux/relu/__init__.py +++ b/build/torch28-cxx11-rocm64-x86_64-linux/relu/__init__.py @@ -1,12 +1,26 @@ -from typing import Optional +import ctypes +import sys -import torch +import importlib +from pathlib import Path +from types import ModuleType -from ._ops import ops +def _import_from_path(file_path: Path) -> ModuleType: + # We cannot use the module name as-is, after adding it to `sys.modules`, + # it would also be used for other imports. So, we make a module name that + # depends on the path for it to be unique using the hex-encoded hash of + # the path. + path_hash = "{:x}".format(ctypes.c_size_t(hash(file_path.absolute())).value) + module_name = path_hash + spec = importlib.util.spec_from_file_location(module_name, file_path) + if spec is None: + raise ImportError(f"Cannot load spec for {module_name} from {file_path}") + module = importlib.util.module_from_spec(spec) + if module is None: + raise ImportError(f"Cannot load module {module_name} from spec") + sys.modules[module_name] = module + spec.loader.exec_module(module) # type: ignore + return module -def relu(x: torch.Tensor, out: Optional[torch.Tensor] = None) -> torch.Tensor: - if out is None: - out = torch.empty_like(x) - ops.relu(out, x) - return out \ No newline at end of file +globals().update(vars(_import_from_path(Path(__file__).parent.parent / "__init__.py"))) diff --git a/build/torch28-cxx11-rocm64-x86_64-linux/relu/__pycache__/__init__.cpython-313.pyc b/build/torch28-cxx11-rocm64-x86_64-linux/relu/__pycache__/__init__.cpython-313.pyc deleted file mode 100644 index 849be8f6e7181285cb329abbdace5c06f8f5cdf3..0000000000000000000000000000000000000000 Binary files a/build/torch28-cxx11-rocm64-x86_64-linux/relu/__pycache__/__init__.cpython-313.pyc and /dev/null differ diff --git a/build/torch28-cxx11-rocm64-x86_64-linux/relu/__pycache__/_ops.cpython-313.pyc b/build/torch28-cxx11-rocm64-x86_64-linux/relu/__pycache__/_ops.cpython-313.pyc deleted file mode 100644 index ec8817aa8623f4e97f93805b5488ebd3ae3077aa..0000000000000000000000000000000000000000 Binary files a/build/torch28-cxx11-rocm64-x86_64-linux/relu/__pycache__/_ops.cpython-313.pyc and /dev/null differ diff --git a/build/torch28-cxx11-rocm64-x86_64-linux/relu/_ops.py b/build/torch28-cxx11-rocm64-x86_64-linux/relu/_ops.py deleted file mode 100644 index c63e9f6664e3cecf51678298652a58dd53e9b0bf..0000000000000000000000000000000000000000 --- a/build/torch28-cxx11-rocm64-x86_64-linux/relu/_ops.py +++ /dev/null @@ -1,9 +0,0 @@ -import torch -from . import _relu_8d21eda -ops = torch.ops._relu_8d21eda - -def add_op_namespace_prefix(op_name: str): - """ - Prefix op by namespace. - """ - return f"_relu_8d21eda::{op_name}" \ No newline at end of file diff --git a/build/torch28-cxx11-rocm64-x86_64-linux/relu/_relu_8d21eda.abi3.so b/build/torch28-cxx11-rocm64-x86_64-linux/relu/_relu_8d21eda.abi3.so deleted file mode 100644 index cd0a6da745fa3952679e38784cfbe29a4d6c95ec..0000000000000000000000000000000000000000 --- a/build/torch28-cxx11-rocm64-x86_64-linux/relu/_relu_8d21eda.abi3.so +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:df7ab05d27a01ee4ae8f7b88454547ad247384d9c58b9a5367cfb6107241a295 -size 1970968 diff --git a/build/torch28-cxx11-xpu20251-x86_64-linux/__init__.py b/build/torch28-cxx11-xpu20251-x86_64-linux/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8050dfd765d1a50720e99d17870c2c854d9e2574 --- /dev/null +++ b/build/torch28-cxx11-xpu20251-x86_64-linux/__init__.py @@ -0,0 +1,12 @@ +from typing import Optional + +import torch + +from ._ops import ops + + +def relu(x: torch.Tensor, out: Optional[torch.Tensor] = None) -> torch.Tensor: + if out is None: + out = torch.empty_like(x) + ops.relu(out, x) + return out \ No newline at end of file diff --git a/build/torch28-cxx11-xpu20251-x86_64-linux/_ops.py b/build/torch28-cxx11-xpu20251-x86_64-linux/_ops.py new file mode 100644 index 0000000000000000000000000000000000000000..2e5edf901b80e2f17196d66460df1c077e0491ac --- /dev/null +++ b/build/torch28-cxx11-xpu20251-x86_64-linux/_ops.py @@ -0,0 +1,9 @@ +import torch +from . import _relu_9f1f069 +ops = torch.ops._relu_9f1f069 + +def add_op_namespace_prefix(op_name: str): + """ + Prefix op by namespace. + """ + return f"_relu_9f1f069::{op_name}" \ No newline at end of file diff --git a/build/torch28-cxx11-xpu20251-x86_64-linux/_relu_9f1f069.abi3.so b/build/torch28-cxx11-xpu20251-x86_64-linux/_relu_9f1f069.abi3.so new file mode 100644 index 0000000000000000000000000000000000000000..df2e506c73da9cd0a181049172978e831f655cc2 --- /dev/null +++ b/build/torch28-cxx11-xpu20251-x86_64-linux/_relu_9f1f069.abi3.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:580355a61256f6977fb85ee1f2ba6d1cd9d1a02a76eec4d325fd33381c51c8f9 +size 2049544 diff --git a/build/torch28-cxx11-xpu20251-x86_64-linux/metadata.json b/build/torch28-cxx11-xpu20251-x86_64-linux/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..76bafa5f33b6818aa6bb4cab04be811b87519b44 --- /dev/null +++ b/build/torch28-cxx11-xpu20251-x86_64-linux/metadata.json @@ -0,0 +1 @@ +{"python-depends":[]} \ No newline at end of file diff --git a/build/torch28-cxx11-xpu20251-x86_64-linux/relu/__init__.py b/build/torch28-cxx11-xpu20251-x86_64-linux/relu/__init__.py index 8050dfd765d1a50720e99d17870c2c854d9e2574..03dbc1afe1cf156661a2b1b22003cd5f599a0309 100644 --- a/build/torch28-cxx11-xpu20251-x86_64-linux/relu/__init__.py +++ b/build/torch28-cxx11-xpu20251-x86_64-linux/relu/__init__.py @@ -1,12 +1,26 @@ -from typing import Optional +import ctypes +import sys -import torch +import importlib +from pathlib import Path +from types import ModuleType -from ._ops import ops +def _import_from_path(file_path: Path) -> ModuleType: + # We cannot use the module name as-is, after adding it to `sys.modules`, + # it would also be used for other imports. So, we make a module name that + # depends on the path for it to be unique using the hex-encoded hash of + # the path. + path_hash = "{:x}".format(ctypes.c_size_t(hash(file_path.absolute())).value) + module_name = path_hash + spec = importlib.util.spec_from_file_location(module_name, file_path) + if spec is None: + raise ImportError(f"Cannot load spec for {module_name} from {file_path}") + module = importlib.util.module_from_spec(spec) + if module is None: + raise ImportError(f"Cannot load module {module_name} from spec") + sys.modules[module_name] = module + spec.loader.exec_module(module) # type: ignore + return module -def relu(x: torch.Tensor, out: Optional[torch.Tensor] = None) -> torch.Tensor: - if out is None: - out = torch.empty_like(x) - ops.relu(out, x) - return out \ No newline at end of file +globals().update(vars(_import_from_path(Path(__file__).parent.parent / "__init__.py"))) diff --git a/build/torch28-cxx11-xpu20251-x86_64-linux/relu/__pycache__/__init__.cpython-313.pyc b/build/torch28-cxx11-xpu20251-x86_64-linux/relu/__pycache__/__init__.cpython-313.pyc deleted file mode 100644 index d500eeb6ca04a82d1d1523d7539663fae84437da..0000000000000000000000000000000000000000 Binary files a/build/torch28-cxx11-xpu20251-x86_64-linux/relu/__pycache__/__init__.cpython-313.pyc and /dev/null differ diff --git a/build/torch28-cxx11-xpu20251-x86_64-linux/relu/__pycache__/_ops.cpython-313.pyc b/build/torch28-cxx11-xpu20251-x86_64-linux/relu/__pycache__/_ops.cpython-313.pyc deleted file mode 100644 index d1df631fbbd09e3fc2a88e8bf081a039fe17f170..0000000000000000000000000000000000000000 Binary files a/build/torch28-cxx11-xpu20251-x86_64-linux/relu/__pycache__/_ops.cpython-313.pyc and /dev/null differ diff --git a/build/torch28-cxx11-xpu20251-x86_64-linux/relu/_ops.py b/build/torch28-cxx11-xpu20251-x86_64-linux/relu/_ops.py deleted file mode 100644 index c63e9f6664e3cecf51678298652a58dd53e9b0bf..0000000000000000000000000000000000000000 --- a/build/torch28-cxx11-xpu20251-x86_64-linux/relu/_ops.py +++ /dev/null @@ -1,9 +0,0 @@ -import torch -from . import _relu_8d21eda -ops = torch.ops._relu_8d21eda - -def add_op_namespace_prefix(op_name: str): - """ - Prefix op by namespace. - """ - return f"_relu_8d21eda::{op_name}" \ No newline at end of file diff --git a/build/torch28-cxx11-xpu20251-x86_64-linux/relu/_relu_8d21eda.abi3.so b/build/torch28-cxx11-xpu20251-x86_64-linux/relu/_relu_8d21eda.abi3.so deleted file mode 100644 index e1ec48e6e81b60b3996f8887e9a240369116c0f8..0000000000000000000000000000000000000000 --- a/build/torch28-cxx11-xpu20251-x86_64-linux/relu/_relu_8d21eda.abi3.so +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:29fa415af8e3accb33c68d8d23af96621100344ad94549f035e99adbfc487346 -size 2030104 diff --git a/build/torch29-cxx11-cu126-x86_64-linux/__init__.py b/build/torch29-cxx11-cu126-x86_64-linux/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8050dfd765d1a50720e99d17870c2c854d9e2574 --- /dev/null +++ b/build/torch29-cxx11-cu126-x86_64-linux/__init__.py @@ -0,0 +1,12 @@ +from typing import Optional + +import torch + +from ._ops import ops + + +def relu(x: torch.Tensor, out: Optional[torch.Tensor] = None) -> torch.Tensor: + if out is None: + out = torch.empty_like(x) + ops.relu(out, x) + return out \ No newline at end of file diff --git a/build/torch29-cxx11-cu126-x86_64-linux/_ops.py b/build/torch29-cxx11-cu126-x86_64-linux/_ops.py new file mode 100644 index 0000000000000000000000000000000000000000..2e5edf901b80e2f17196d66460df1c077e0491ac --- /dev/null +++ b/build/torch29-cxx11-cu126-x86_64-linux/_ops.py @@ -0,0 +1,9 @@ +import torch +from . import _relu_9f1f069 +ops = torch.ops._relu_9f1f069 + +def add_op_namespace_prefix(op_name: str): + """ + Prefix op by namespace. + """ + return f"_relu_9f1f069::{op_name}" \ No newline at end of file diff --git a/build/torch29-cxx11-cu126-x86_64-linux/_relu_9f1f069.abi3.so b/build/torch29-cxx11-cu126-x86_64-linux/_relu_9f1f069.abi3.so new file mode 100644 index 0000000000000000000000000000000000000000..333e3b6b2c884c739e0fe10891ab357800342059 --- /dev/null +++ b/build/torch29-cxx11-cu126-x86_64-linux/_relu_9f1f069.abi3.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:adaa09fda0b8c00fe8032f58106f01e6599952d91abb7ab5c5cb1da085dd5cef +size 2014176 diff --git a/build/torch29-cxx11-cu126-x86_64-linux/metadata.json b/build/torch29-cxx11-cu126-x86_64-linux/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..76bafa5f33b6818aa6bb4cab04be811b87519b44 --- /dev/null +++ b/build/torch29-cxx11-cu126-x86_64-linux/metadata.json @@ -0,0 +1 @@ +{"python-depends":[]} \ No newline at end of file diff --git a/build/torch29-cxx11-cu126-x86_64-linux/relu/__init__.py b/build/torch29-cxx11-cu126-x86_64-linux/relu/__init__.py index d801867e69a799a8dc4501b72742a65480e59546..03dbc1afe1cf156661a2b1b22003cd5f599a0309 100644 --- a/build/torch29-cxx11-cu126-x86_64-linux/relu/__init__.py +++ b/build/torch29-cxx11-cu126-x86_64-linux/relu/__init__.py @@ -1,12 +1,26 @@ -from typing import Optional +import ctypes +import sys -import torch +import importlib +from pathlib import Path +from types import ModuleType -from ._ops import ops +def _import_from_path(file_path: Path) -> ModuleType: + # We cannot use the module name as-is, after adding it to `sys.modules`, + # it would also be used for other imports. So, we make a module name that + # depends on the path for it to be unique using the hex-encoded hash of + # the path. + path_hash = "{:x}".format(ctypes.c_size_t(hash(file_path.absolute())).value) + module_name = path_hash + spec = importlib.util.spec_from_file_location(module_name, file_path) + if spec is None: + raise ImportError(f"Cannot load spec for {module_name} from {file_path}") + module = importlib.util.module_from_spec(spec) + if module is None: + raise ImportError(f"Cannot load module {module_name} from spec") + sys.modules[module_name] = module + spec.loader.exec_module(module) # type: ignore + return module -def relu(x: torch.Tensor, out: Optional[torch.Tensor] = None) -> torch.Tensor: - if out is None: - out = torch.empty_like(x) - ops.relu(out, x) - return out +globals().update(vars(_import_from_path(Path(__file__).parent.parent / "__init__.py"))) diff --git a/build/torch29-cxx11-cu126-x86_64-linux/relu/__pycache__/__init__.cpython-313.pyc b/build/torch29-cxx11-cu126-x86_64-linux/relu/__pycache__/__init__.cpython-313.pyc deleted file mode 100644 index bd54c78215038ecd028f1220e7dd3f5341733e96..0000000000000000000000000000000000000000 Binary files a/build/torch29-cxx11-cu126-x86_64-linux/relu/__pycache__/__init__.cpython-313.pyc and /dev/null differ diff --git a/build/torch29-cxx11-cu126-x86_64-linux/relu/__pycache__/_ops.cpython-313.pyc b/build/torch29-cxx11-cu126-x86_64-linux/relu/__pycache__/_ops.cpython-313.pyc deleted file mode 100644 index c340081b17e87d468b675fb452b721c24c2cfc39..0000000000000000000000000000000000000000 Binary files a/build/torch29-cxx11-cu126-x86_64-linux/relu/__pycache__/_ops.cpython-313.pyc and /dev/null differ diff --git a/build/torch29-cxx11-cu126-x86_64-linux/relu/_ops.py b/build/torch29-cxx11-cu126-x86_64-linux/relu/_ops.py deleted file mode 100644 index 98716ed189b0eba3705e6191bb15c3bad7ad65ec..0000000000000000000000000000000000000000 --- a/build/torch29-cxx11-cu126-x86_64-linux/relu/_ops.py +++ /dev/null @@ -1,9 +0,0 @@ -import torch -from . import _relu_46e4283 -ops = torch.ops._relu_46e4283 - -def add_op_namespace_prefix(op_name: str): - """ - Prefix op by namespace. - """ - return f"_relu_46e4283::{op_name}" \ No newline at end of file diff --git a/build/torch29-cxx11-cu126-x86_64-linux/relu/_relu_46e4283.abi3.so b/build/torch29-cxx11-cu126-x86_64-linux/relu/_relu_46e4283.abi3.so deleted file mode 100644 index 87339ae4c30726677522095cf7536d67fe18d415..0000000000000000000000000000000000000000 --- a/build/torch29-cxx11-cu126-x86_64-linux/relu/_relu_46e4283.abi3.so +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:568ffdc8884fd0d01a0690745bb744f0fc556d1c0a4ae204abf750f632146fd5 -size 1977272 diff --git a/build/torch29-cxx11-cu128-x86_64-linux/__init__.py b/build/torch29-cxx11-cu128-x86_64-linux/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8050dfd765d1a50720e99d17870c2c854d9e2574 --- /dev/null +++ b/build/torch29-cxx11-cu128-x86_64-linux/__init__.py @@ -0,0 +1,12 @@ +from typing import Optional + +import torch + +from ._ops import ops + + +def relu(x: torch.Tensor, out: Optional[torch.Tensor] = None) -> torch.Tensor: + if out is None: + out = torch.empty_like(x) + ops.relu(out, x) + return out \ No newline at end of file diff --git a/build/torch29-cxx11-cu128-x86_64-linux/_ops.py b/build/torch29-cxx11-cu128-x86_64-linux/_ops.py new file mode 100644 index 0000000000000000000000000000000000000000..2e5edf901b80e2f17196d66460df1c077e0491ac --- /dev/null +++ b/build/torch29-cxx11-cu128-x86_64-linux/_ops.py @@ -0,0 +1,9 @@ +import torch +from . import _relu_9f1f069 +ops = torch.ops._relu_9f1f069 + +def add_op_namespace_prefix(op_name: str): + """ + Prefix op by namespace. + """ + return f"_relu_9f1f069::{op_name}" \ No newline at end of file diff --git a/build/torch29-cxx11-cu128-x86_64-linux/_relu_9f1f069.abi3.so b/build/torch29-cxx11-cu128-x86_64-linux/_relu_9f1f069.abi3.so new file mode 100644 index 0000000000000000000000000000000000000000..e4a1345aa29e88719fba1103c638f4b37bbeedc3 --- /dev/null +++ b/build/torch29-cxx11-cu128-x86_64-linux/_relu_9f1f069.abi3.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:538cbc98afbcdd872169260f5073f18063dcf88c44b1ec87759a276b9849a0b3 +size 2101904 diff --git a/build/torch29-cxx11-cu128-x86_64-linux/metadata.json b/build/torch29-cxx11-cu128-x86_64-linux/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..76bafa5f33b6818aa6bb4cab04be811b87519b44 --- /dev/null +++ b/build/torch29-cxx11-cu128-x86_64-linux/metadata.json @@ -0,0 +1 @@ +{"python-depends":[]} \ No newline at end of file diff --git a/build/torch29-cxx11-cu128-x86_64-linux/relu/__init__.py b/build/torch29-cxx11-cu128-x86_64-linux/relu/__init__.py index 8050dfd765d1a50720e99d17870c2c854d9e2574..03dbc1afe1cf156661a2b1b22003cd5f599a0309 100644 --- a/build/torch29-cxx11-cu128-x86_64-linux/relu/__init__.py +++ b/build/torch29-cxx11-cu128-x86_64-linux/relu/__init__.py @@ -1,12 +1,26 @@ -from typing import Optional +import ctypes +import sys -import torch +import importlib +from pathlib import Path +from types import ModuleType -from ._ops import ops +def _import_from_path(file_path: Path) -> ModuleType: + # We cannot use the module name as-is, after adding it to `sys.modules`, + # it would also be used for other imports. So, we make a module name that + # depends on the path for it to be unique using the hex-encoded hash of + # the path. + path_hash = "{:x}".format(ctypes.c_size_t(hash(file_path.absolute())).value) + module_name = path_hash + spec = importlib.util.spec_from_file_location(module_name, file_path) + if spec is None: + raise ImportError(f"Cannot load spec for {module_name} from {file_path}") + module = importlib.util.module_from_spec(spec) + if module is None: + raise ImportError(f"Cannot load module {module_name} from spec") + sys.modules[module_name] = module + spec.loader.exec_module(module) # type: ignore + return module -def relu(x: torch.Tensor, out: Optional[torch.Tensor] = None) -> torch.Tensor: - if out is None: - out = torch.empty_like(x) - ops.relu(out, x) - return out \ No newline at end of file +globals().update(vars(_import_from_path(Path(__file__).parent.parent / "__init__.py"))) diff --git a/build/torch29-cxx11-cu128-x86_64-linux/relu/__pycache__/__init__.cpython-313.pyc b/build/torch29-cxx11-cu128-x86_64-linux/relu/__pycache__/__init__.cpython-313.pyc deleted file mode 100644 index 45857cf715627668390a0a399a6953e3e735b53f..0000000000000000000000000000000000000000 Binary files a/build/torch29-cxx11-cu128-x86_64-linux/relu/__pycache__/__init__.cpython-313.pyc and /dev/null differ diff --git a/build/torch29-cxx11-cu128-x86_64-linux/relu/__pycache__/_ops.cpython-313.pyc b/build/torch29-cxx11-cu128-x86_64-linux/relu/__pycache__/_ops.cpython-313.pyc deleted file mode 100644 index f7b5ab202eaf3f0cfb74e5d2cdf88b744ced9edf..0000000000000000000000000000000000000000 Binary files a/build/torch29-cxx11-cu128-x86_64-linux/relu/__pycache__/_ops.cpython-313.pyc and /dev/null differ diff --git a/build/torch29-cxx11-cu128-x86_64-linux/relu/_ops.py b/build/torch29-cxx11-cu128-x86_64-linux/relu/_ops.py deleted file mode 100644 index c63e9f6664e3cecf51678298652a58dd53e9b0bf..0000000000000000000000000000000000000000 --- a/build/torch29-cxx11-cu128-x86_64-linux/relu/_ops.py +++ /dev/null @@ -1,9 +0,0 @@ -import torch -from . import _relu_8d21eda -ops = torch.ops._relu_8d21eda - -def add_op_namespace_prefix(op_name: str): - """ - Prefix op by namespace. - """ - return f"_relu_8d21eda::{op_name}" \ No newline at end of file diff --git a/build/torch29-cxx11-cu128-x86_64-linux/relu/_relu_8d21eda.abi3.so b/build/torch29-cxx11-cu128-x86_64-linux/relu/_relu_8d21eda.abi3.so deleted file mode 100644 index 716fa055db1b2a2ee43d38b0567dbc7669de2481..0000000000000000000000000000000000000000 --- a/build/torch29-cxx11-cu128-x86_64-linux/relu/_relu_8d21eda.abi3.so +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e02aedce3cf54bd8dcc71fdd3919aea73acb617790c4adf4f0ecd8672021020c -size 2064048 diff --git a/build/torch29-cxx11-cu130-x86_64-linux/__init__.py b/build/torch29-cxx11-cu130-x86_64-linux/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8050dfd765d1a50720e99d17870c2c854d9e2574 --- /dev/null +++ b/build/torch29-cxx11-cu130-x86_64-linux/__init__.py @@ -0,0 +1,12 @@ +from typing import Optional + +import torch + +from ._ops import ops + + +def relu(x: torch.Tensor, out: Optional[torch.Tensor] = None) -> torch.Tensor: + if out is None: + out = torch.empty_like(x) + ops.relu(out, x) + return out \ No newline at end of file diff --git a/build/torch29-cxx11-cu130-x86_64-linux/_ops.py b/build/torch29-cxx11-cu130-x86_64-linux/_ops.py new file mode 100644 index 0000000000000000000000000000000000000000..2e5edf901b80e2f17196d66460df1c077e0491ac --- /dev/null +++ b/build/torch29-cxx11-cu130-x86_64-linux/_ops.py @@ -0,0 +1,9 @@ +import torch +from . import _relu_9f1f069 +ops = torch.ops._relu_9f1f069 + +def add_op_namespace_prefix(op_name: str): + """ + Prefix op by namespace. + """ + return f"_relu_9f1f069::{op_name}" \ No newline at end of file diff --git a/build/torch29-cxx11-cu130-x86_64-linux/_relu_9f1f069.abi3.so b/build/torch29-cxx11-cu130-x86_64-linux/_relu_9f1f069.abi3.so new file mode 100644 index 0000000000000000000000000000000000000000..4cad79fe6bc25240df9110d04a6908dff747bd0c --- /dev/null +++ b/build/torch29-cxx11-cu130-x86_64-linux/_relu_9f1f069.abi3.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:351b103bddc869b606a6d6dea56c4bb828177340c6288dcdda77beba6fc261f8 +size 2127912 diff --git a/build/torch29-cxx11-cu130-x86_64-linux/metadata.json b/build/torch29-cxx11-cu130-x86_64-linux/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..76bafa5f33b6818aa6bb4cab04be811b87519b44 --- /dev/null +++ b/build/torch29-cxx11-cu130-x86_64-linux/metadata.json @@ -0,0 +1 @@ +{"python-depends":[]} \ No newline at end of file diff --git a/build/torch29-cxx11-cu130-x86_64-linux/relu/__init__.py b/build/torch29-cxx11-cu130-x86_64-linux/relu/__init__.py index 8050dfd765d1a50720e99d17870c2c854d9e2574..03dbc1afe1cf156661a2b1b22003cd5f599a0309 100644 --- a/build/torch29-cxx11-cu130-x86_64-linux/relu/__init__.py +++ b/build/torch29-cxx11-cu130-x86_64-linux/relu/__init__.py @@ -1,12 +1,26 @@ -from typing import Optional +import ctypes +import sys -import torch +import importlib +from pathlib import Path +from types import ModuleType -from ._ops import ops +def _import_from_path(file_path: Path) -> ModuleType: + # We cannot use the module name as-is, after adding it to `sys.modules`, + # it would also be used for other imports. So, we make a module name that + # depends on the path for it to be unique using the hex-encoded hash of + # the path. + path_hash = "{:x}".format(ctypes.c_size_t(hash(file_path.absolute())).value) + module_name = path_hash + spec = importlib.util.spec_from_file_location(module_name, file_path) + if spec is None: + raise ImportError(f"Cannot load spec for {module_name} from {file_path}") + module = importlib.util.module_from_spec(spec) + if module is None: + raise ImportError(f"Cannot load module {module_name} from spec") + sys.modules[module_name] = module + spec.loader.exec_module(module) # type: ignore + return module -def relu(x: torch.Tensor, out: Optional[torch.Tensor] = None) -> torch.Tensor: - if out is None: - out = torch.empty_like(x) - ops.relu(out, x) - return out \ No newline at end of file +globals().update(vars(_import_from_path(Path(__file__).parent.parent / "__init__.py"))) diff --git a/build/torch29-cxx11-cu130-x86_64-linux/relu/__pycache__/__init__.cpython-313.pyc b/build/torch29-cxx11-cu130-x86_64-linux/relu/__pycache__/__init__.cpython-313.pyc deleted file mode 100644 index 5c9e7e6a1e0e9a7a6aca1d8b234a9ab92a64d565..0000000000000000000000000000000000000000 Binary files a/build/torch29-cxx11-cu130-x86_64-linux/relu/__pycache__/__init__.cpython-313.pyc and /dev/null differ diff --git a/build/torch29-cxx11-cu130-x86_64-linux/relu/__pycache__/_ops.cpython-313.pyc b/build/torch29-cxx11-cu130-x86_64-linux/relu/__pycache__/_ops.cpython-313.pyc deleted file mode 100644 index 23154f221b02eb00679a54e3ca9c1b3b78653f25..0000000000000000000000000000000000000000 Binary files a/build/torch29-cxx11-cu130-x86_64-linux/relu/__pycache__/_ops.cpython-313.pyc and /dev/null differ diff --git a/build/torch29-cxx11-cu130-x86_64-linux/relu/_ops.py b/build/torch29-cxx11-cu130-x86_64-linux/relu/_ops.py deleted file mode 100644 index c63e9f6664e3cecf51678298652a58dd53e9b0bf..0000000000000000000000000000000000000000 --- a/build/torch29-cxx11-cu130-x86_64-linux/relu/_ops.py +++ /dev/null @@ -1,9 +0,0 @@ -import torch -from . import _relu_8d21eda -ops = torch.ops._relu_8d21eda - -def add_op_namespace_prefix(op_name: str): - """ - Prefix op by namespace. - """ - return f"_relu_8d21eda::{op_name}" \ No newline at end of file diff --git a/build/torch29-cxx11-cu130-x86_64-linux/relu/_relu_8d21eda.abi3.so b/build/torch29-cxx11-cu130-x86_64-linux/relu/_relu_8d21eda.abi3.so deleted file mode 100644 index c97ff71ff90a16aafa34c7ab0be2e28f9384bef9..0000000000000000000000000000000000000000 --- a/build/torch29-cxx11-cu130-x86_64-linux/relu/_relu_8d21eda.abi3.so +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:aeef31eb76915c77536b86df069135af29848b479078acd02a545de80a33913a -size 2082376 diff --git a/build/torch29-cxx11-rocm63-x86_64-linux/__init__.py b/build/torch29-cxx11-rocm63-x86_64-linux/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8050dfd765d1a50720e99d17870c2c854d9e2574 --- /dev/null +++ b/build/torch29-cxx11-rocm63-x86_64-linux/__init__.py @@ -0,0 +1,12 @@ +from typing import Optional + +import torch + +from ._ops import ops + + +def relu(x: torch.Tensor, out: Optional[torch.Tensor] = None) -> torch.Tensor: + if out is None: + out = torch.empty_like(x) + ops.relu(out, x) + return out \ No newline at end of file diff --git a/build/torch29-cxx11-rocm63-x86_64-linux/_ops.py b/build/torch29-cxx11-rocm63-x86_64-linux/_ops.py new file mode 100644 index 0000000000000000000000000000000000000000..2e5edf901b80e2f17196d66460df1c077e0491ac --- /dev/null +++ b/build/torch29-cxx11-rocm63-x86_64-linux/_ops.py @@ -0,0 +1,9 @@ +import torch +from . import _relu_9f1f069 +ops = torch.ops._relu_9f1f069 + +def add_op_namespace_prefix(op_name: str): + """ + Prefix op by namespace. + """ + return f"_relu_9f1f069::{op_name}" \ No newline at end of file diff --git a/build/torch29-cxx11-rocm63-x86_64-linux/_relu_9f1f069.abi3.so b/build/torch29-cxx11-rocm63-x86_64-linux/_relu_9f1f069.abi3.so new file mode 100644 index 0000000000000000000000000000000000000000..2e5c2f0c83e449a1386cba6b1b6be59817369938 --- /dev/null +++ b/build/torch29-cxx11-rocm63-x86_64-linux/_relu_9f1f069.abi3.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e12e09f5304da27ac819c109dc8d82ac2a6dfac5635ba5c845d53238668380a4 +size 1970448 diff --git a/build/torch29-cxx11-rocm63-x86_64-linux/metadata.json b/build/torch29-cxx11-rocm63-x86_64-linux/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..76bafa5f33b6818aa6bb4cab04be811b87519b44 --- /dev/null +++ b/build/torch29-cxx11-rocm63-x86_64-linux/metadata.json @@ -0,0 +1 @@ +{"python-depends":[]} \ No newline at end of file diff --git a/build/torch29-cxx11-rocm63-x86_64-linux/relu/__init__.py b/build/torch29-cxx11-rocm63-x86_64-linux/relu/__init__.py index 8050dfd765d1a50720e99d17870c2c854d9e2574..03dbc1afe1cf156661a2b1b22003cd5f599a0309 100644 --- a/build/torch29-cxx11-rocm63-x86_64-linux/relu/__init__.py +++ b/build/torch29-cxx11-rocm63-x86_64-linux/relu/__init__.py @@ -1,12 +1,26 @@ -from typing import Optional +import ctypes +import sys -import torch +import importlib +from pathlib import Path +from types import ModuleType -from ._ops import ops +def _import_from_path(file_path: Path) -> ModuleType: + # We cannot use the module name as-is, after adding it to `sys.modules`, + # it would also be used for other imports. So, we make a module name that + # depends on the path for it to be unique using the hex-encoded hash of + # the path. + path_hash = "{:x}".format(ctypes.c_size_t(hash(file_path.absolute())).value) + module_name = path_hash + spec = importlib.util.spec_from_file_location(module_name, file_path) + if spec is None: + raise ImportError(f"Cannot load spec for {module_name} from {file_path}") + module = importlib.util.module_from_spec(spec) + if module is None: + raise ImportError(f"Cannot load module {module_name} from spec") + sys.modules[module_name] = module + spec.loader.exec_module(module) # type: ignore + return module -def relu(x: torch.Tensor, out: Optional[torch.Tensor] = None) -> torch.Tensor: - if out is None: - out = torch.empty_like(x) - ops.relu(out, x) - return out \ No newline at end of file +globals().update(vars(_import_from_path(Path(__file__).parent.parent / "__init__.py"))) diff --git a/build/torch29-cxx11-rocm63-x86_64-linux/relu/__pycache__/__init__.cpython-313.pyc b/build/torch29-cxx11-rocm63-x86_64-linux/relu/__pycache__/__init__.cpython-313.pyc deleted file mode 100644 index b3ca34c19a4d4df7a266ea4f180e2fd438ee9c00..0000000000000000000000000000000000000000 Binary files a/build/torch29-cxx11-rocm63-x86_64-linux/relu/__pycache__/__init__.cpython-313.pyc and /dev/null differ diff --git a/build/torch29-cxx11-rocm63-x86_64-linux/relu/__pycache__/_ops.cpython-313.pyc b/build/torch29-cxx11-rocm63-x86_64-linux/relu/__pycache__/_ops.cpython-313.pyc deleted file mode 100644 index 0f479809ce96756251a4e60c71a94146724194bb..0000000000000000000000000000000000000000 Binary files a/build/torch29-cxx11-rocm63-x86_64-linux/relu/__pycache__/_ops.cpython-313.pyc and /dev/null differ diff --git a/build/torch29-cxx11-rocm63-x86_64-linux/relu/_ops.py b/build/torch29-cxx11-rocm63-x86_64-linux/relu/_ops.py deleted file mode 100644 index c63e9f6664e3cecf51678298652a58dd53e9b0bf..0000000000000000000000000000000000000000 --- a/build/torch29-cxx11-rocm63-x86_64-linux/relu/_ops.py +++ /dev/null @@ -1,9 +0,0 @@ -import torch -from . import _relu_8d21eda -ops = torch.ops._relu_8d21eda - -def add_op_namespace_prefix(op_name: str): - """ - Prefix op by namespace. - """ - return f"_relu_8d21eda::{op_name}" \ No newline at end of file diff --git a/build/torch29-cxx11-rocm63-x86_64-linux/relu/_relu_8d21eda.abi3.so b/build/torch29-cxx11-rocm63-x86_64-linux/relu/_relu_8d21eda.abi3.so deleted file mode 100644 index 3cd1de484d0ee1fc5011fbb1aed486dcd481dc67..0000000000000000000000000000000000000000 --- a/build/torch29-cxx11-rocm63-x86_64-linux/relu/_relu_8d21eda.abi3.so +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9255191b4a60382595efa050f96ee5514e86767f889156e928701a0e2afb1efc -size 1960576 diff --git a/build/torch29-cxx11-rocm64-x86_64-linux/__init__.py b/build/torch29-cxx11-rocm64-x86_64-linux/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8050dfd765d1a50720e99d17870c2c854d9e2574 --- /dev/null +++ b/build/torch29-cxx11-rocm64-x86_64-linux/__init__.py @@ -0,0 +1,12 @@ +from typing import Optional + +import torch + +from ._ops import ops + + +def relu(x: torch.Tensor, out: Optional[torch.Tensor] = None) -> torch.Tensor: + if out is None: + out = torch.empty_like(x) + ops.relu(out, x) + return out \ No newline at end of file diff --git a/build/torch29-cxx11-rocm64-x86_64-linux/_ops.py b/build/torch29-cxx11-rocm64-x86_64-linux/_ops.py new file mode 100644 index 0000000000000000000000000000000000000000..2e5edf901b80e2f17196d66460df1c077e0491ac --- /dev/null +++ b/build/torch29-cxx11-rocm64-x86_64-linux/_ops.py @@ -0,0 +1,9 @@ +import torch +from . import _relu_9f1f069 +ops = torch.ops._relu_9f1f069 + +def add_op_namespace_prefix(op_name: str): + """ + Prefix op by namespace. + """ + return f"_relu_9f1f069::{op_name}" \ No newline at end of file diff --git a/build/torch29-cxx11-rocm64-x86_64-linux/_relu_9f1f069.abi3.so b/build/torch29-cxx11-rocm64-x86_64-linux/_relu_9f1f069.abi3.so new file mode 100644 index 0000000000000000000000000000000000000000..10a0c479c6265385691edf70b33dc969f29e5191 --- /dev/null +++ b/build/torch29-cxx11-rocm64-x86_64-linux/_relu_9f1f069.abi3.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2e66a1c949ead2bc606247f97b2f2d4ba9bedcf533984ad8a79a3cab2e2c620c +size 1989224 diff --git a/build/torch29-cxx11-rocm64-x86_64-linux/metadata.json b/build/torch29-cxx11-rocm64-x86_64-linux/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..76bafa5f33b6818aa6bb4cab04be811b87519b44 --- /dev/null +++ b/build/torch29-cxx11-rocm64-x86_64-linux/metadata.json @@ -0,0 +1 @@ +{"python-depends":[]} \ No newline at end of file diff --git a/build/torch29-cxx11-rocm64-x86_64-linux/relu/__init__.py b/build/torch29-cxx11-rocm64-x86_64-linux/relu/__init__.py index 8050dfd765d1a50720e99d17870c2c854d9e2574..03dbc1afe1cf156661a2b1b22003cd5f599a0309 100644 --- a/build/torch29-cxx11-rocm64-x86_64-linux/relu/__init__.py +++ b/build/torch29-cxx11-rocm64-x86_64-linux/relu/__init__.py @@ -1,12 +1,26 @@ -from typing import Optional +import ctypes +import sys -import torch +import importlib +from pathlib import Path +from types import ModuleType -from ._ops import ops +def _import_from_path(file_path: Path) -> ModuleType: + # We cannot use the module name as-is, after adding it to `sys.modules`, + # it would also be used for other imports. So, we make a module name that + # depends on the path for it to be unique using the hex-encoded hash of + # the path. + path_hash = "{:x}".format(ctypes.c_size_t(hash(file_path.absolute())).value) + module_name = path_hash + spec = importlib.util.spec_from_file_location(module_name, file_path) + if spec is None: + raise ImportError(f"Cannot load spec for {module_name} from {file_path}") + module = importlib.util.module_from_spec(spec) + if module is None: + raise ImportError(f"Cannot load module {module_name} from spec") + sys.modules[module_name] = module + spec.loader.exec_module(module) # type: ignore + return module -def relu(x: torch.Tensor, out: Optional[torch.Tensor] = None) -> torch.Tensor: - if out is None: - out = torch.empty_like(x) - ops.relu(out, x) - return out \ No newline at end of file +globals().update(vars(_import_from_path(Path(__file__).parent.parent / "__init__.py"))) diff --git a/build/torch29-cxx11-rocm64-x86_64-linux/relu/__pycache__/__init__.cpython-313.pyc b/build/torch29-cxx11-rocm64-x86_64-linux/relu/__pycache__/__init__.cpython-313.pyc deleted file mode 100644 index 240578369d5b9ecfe3f5a2930d613c7a9026d842..0000000000000000000000000000000000000000 Binary files a/build/torch29-cxx11-rocm64-x86_64-linux/relu/__pycache__/__init__.cpython-313.pyc and /dev/null differ diff --git a/build/torch29-cxx11-rocm64-x86_64-linux/relu/__pycache__/_ops.cpython-313.pyc b/build/torch29-cxx11-rocm64-x86_64-linux/relu/__pycache__/_ops.cpython-313.pyc deleted file mode 100644 index 31b9d35e9de66709754b9fb2355e418c25903171..0000000000000000000000000000000000000000 Binary files a/build/torch29-cxx11-rocm64-x86_64-linux/relu/__pycache__/_ops.cpython-313.pyc and /dev/null differ diff --git a/build/torch29-cxx11-rocm64-x86_64-linux/relu/_ops.py b/build/torch29-cxx11-rocm64-x86_64-linux/relu/_ops.py deleted file mode 100644 index c63e9f6664e3cecf51678298652a58dd53e9b0bf..0000000000000000000000000000000000000000 --- a/build/torch29-cxx11-rocm64-x86_64-linux/relu/_ops.py +++ /dev/null @@ -1,9 +0,0 @@ -import torch -from . import _relu_8d21eda -ops = torch.ops._relu_8d21eda - -def add_op_namespace_prefix(op_name: str): - """ - Prefix op by namespace. - """ - return f"_relu_8d21eda::{op_name}" \ No newline at end of file diff --git a/build/torch29-cxx11-rocm64-x86_64-linux/relu/_relu_8d21eda.abi3.so b/build/torch29-cxx11-rocm64-x86_64-linux/relu/_relu_8d21eda.abi3.so deleted file mode 100644 index a026ca96fff7925b9ec41324f762f14e80a0b15e..0000000000000000000000000000000000000000 --- a/build/torch29-cxx11-rocm64-x86_64-linux/relu/_relu_8d21eda.abi3.so +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6b92da6f2346439480216351c7756ed66aa6e67b4b9bc9242015264f99fb7d27 -size 1975256 diff --git a/build/torch29-cxx11-xpu20252-x86_64-linux/__init__.py b/build/torch29-cxx11-xpu20252-x86_64-linux/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8050dfd765d1a50720e99d17870c2c854d9e2574 --- /dev/null +++ b/build/torch29-cxx11-xpu20252-x86_64-linux/__init__.py @@ -0,0 +1,12 @@ +from typing import Optional + +import torch + +from ._ops import ops + + +def relu(x: torch.Tensor, out: Optional[torch.Tensor] = None) -> torch.Tensor: + if out is None: + out = torch.empty_like(x) + ops.relu(out, x) + return out \ No newline at end of file diff --git a/build/torch29-cxx11-xpu20252-x86_64-linux/_ops.py b/build/torch29-cxx11-xpu20252-x86_64-linux/_ops.py new file mode 100644 index 0000000000000000000000000000000000000000..2e5edf901b80e2f17196d66460df1c077e0491ac --- /dev/null +++ b/build/torch29-cxx11-xpu20252-x86_64-linux/_ops.py @@ -0,0 +1,9 @@ +import torch +from . import _relu_9f1f069 +ops = torch.ops._relu_9f1f069 + +def add_op_namespace_prefix(op_name: str): + """ + Prefix op by namespace. + """ + return f"_relu_9f1f069::{op_name}" \ No newline at end of file diff --git a/build/torch29-cxx11-xpu20252-x86_64-linux/_relu_9f1f069.abi3.so b/build/torch29-cxx11-xpu20252-x86_64-linux/_relu_9f1f069.abi3.so new file mode 100644 index 0000000000000000000000000000000000000000..30edb2baf8aa39ce3c36084398571f3a8f15faba --- /dev/null +++ b/build/torch29-cxx11-xpu20252-x86_64-linux/_relu_9f1f069.abi3.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:61e2960692c64b89d41bdc120c6738c248b50b06a19a388135852bbe862a18bb +size 2048320 diff --git a/build/torch29-cxx11-xpu20252-x86_64-linux/metadata.json b/build/torch29-cxx11-xpu20252-x86_64-linux/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..76bafa5f33b6818aa6bb4cab04be811b87519b44 --- /dev/null +++ b/build/torch29-cxx11-xpu20252-x86_64-linux/metadata.json @@ -0,0 +1 @@ +{"python-depends":[]} \ No newline at end of file diff --git a/build/torch29-cxx11-xpu20252-x86_64-linux/relu/__init__.py b/build/torch29-cxx11-xpu20252-x86_64-linux/relu/__init__.py index 8050dfd765d1a50720e99d17870c2c854d9e2574..03dbc1afe1cf156661a2b1b22003cd5f599a0309 100644 --- a/build/torch29-cxx11-xpu20252-x86_64-linux/relu/__init__.py +++ b/build/torch29-cxx11-xpu20252-x86_64-linux/relu/__init__.py @@ -1,12 +1,26 @@ -from typing import Optional +import ctypes +import sys -import torch +import importlib +from pathlib import Path +from types import ModuleType -from ._ops import ops +def _import_from_path(file_path: Path) -> ModuleType: + # We cannot use the module name as-is, after adding it to `sys.modules`, + # it would also be used for other imports. So, we make a module name that + # depends on the path for it to be unique using the hex-encoded hash of + # the path. + path_hash = "{:x}".format(ctypes.c_size_t(hash(file_path.absolute())).value) + module_name = path_hash + spec = importlib.util.spec_from_file_location(module_name, file_path) + if spec is None: + raise ImportError(f"Cannot load spec for {module_name} from {file_path}") + module = importlib.util.module_from_spec(spec) + if module is None: + raise ImportError(f"Cannot load module {module_name} from spec") + sys.modules[module_name] = module + spec.loader.exec_module(module) # type: ignore + return module -def relu(x: torch.Tensor, out: Optional[torch.Tensor] = None) -> torch.Tensor: - if out is None: - out = torch.empty_like(x) - ops.relu(out, x) - return out \ No newline at end of file +globals().update(vars(_import_from_path(Path(__file__).parent.parent / "__init__.py"))) diff --git a/build/torch29-cxx11-xpu20252-x86_64-linux/relu/__pycache__/__init__.cpython-313.pyc b/build/torch29-cxx11-xpu20252-x86_64-linux/relu/__pycache__/__init__.cpython-313.pyc deleted file mode 100644 index c38db0649f8094ce95579b9b1179522d816c67a3..0000000000000000000000000000000000000000 Binary files a/build/torch29-cxx11-xpu20252-x86_64-linux/relu/__pycache__/__init__.cpython-313.pyc and /dev/null differ diff --git a/build/torch29-cxx11-xpu20252-x86_64-linux/relu/__pycache__/_ops.cpython-313.pyc b/build/torch29-cxx11-xpu20252-x86_64-linux/relu/__pycache__/_ops.cpython-313.pyc deleted file mode 100644 index d4f714d14f9fa6541245c78bc41d99aea868c165..0000000000000000000000000000000000000000 Binary files a/build/torch29-cxx11-xpu20252-x86_64-linux/relu/__pycache__/_ops.cpython-313.pyc and /dev/null differ diff --git a/build/torch29-cxx11-xpu20252-x86_64-linux/relu/_ops.py b/build/torch29-cxx11-xpu20252-x86_64-linux/relu/_ops.py deleted file mode 100644 index c63e9f6664e3cecf51678298652a58dd53e9b0bf..0000000000000000000000000000000000000000 --- a/build/torch29-cxx11-xpu20252-x86_64-linux/relu/_ops.py +++ /dev/null @@ -1,9 +0,0 @@ -import torch -from . import _relu_8d21eda -ops = torch.ops._relu_8d21eda - -def add_op_namespace_prefix(op_name: str): - """ - Prefix op by namespace. - """ - return f"_relu_8d21eda::{op_name}" \ No newline at end of file diff --git a/build/torch29-cxx11-xpu20252-x86_64-linux/relu/_relu_8d21eda.abi3.so b/build/torch29-cxx11-xpu20252-x86_64-linux/relu/_relu_8d21eda.abi3.so deleted file mode 100644 index a534ebb7fc6ff31d5eb65306d1427801d2721acd..0000000000000000000000000000000000000000 --- a/build/torch29-cxx11-xpu20252-x86_64-linux/relu/_relu_8d21eda.abi3.so +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8a104df67677c1f4cd8dd039484992f74ad8d03fb3e15e59c0b54c3e55fd5d8e -size 2028880