mirror of
https://github.com/jung-geun/PSO.git
synced 2026-09-20 14:11:48 +09:00
Migrate the package and examples to the tensor-native PyTorch implementation, add benchmark evidence, and add the guarded post-training convergence protocol with TensorBoard progress monitoring and hash-verified recovery. Constraint: Preserve one-shot official-test sealing and auditable research artifacts Rejected: Commit local .omc runs and downloaded datasets | multi-gigabyte runtime state is machine-local Confidence: high Scope-risk: broad Not-tested: Production CUDA run on pieroot-server
23 lines
689 B
Python
23 lines
689 B
Python
from pathlib import Path
|
|
import sys
|
|
from importlib.metadata import PackageNotFoundError, version
|
|
|
|
try:
|
|
__version__ = version("pso2keras")
|
|
except PackageNotFoundError:
|
|
pyproject_path = Path(__file__).resolve().parent.parent / "pyproject.toml"
|
|
if pyproject_path.exists():
|
|
if sys.version_info >= (3, 11):
|
|
import tomllib
|
|
else:
|
|
try:
|
|
import tomllib # type: ignore
|
|
except ImportError:
|
|
import tomli as tomllib # type: ignore
|
|
|
|
with pyproject_path.open("rb") as f:
|
|
data = tomllib.load(f)
|
|
__version__ = data["project"]["version"]
|
|
else:
|
|
__version__ = "0.0.0"
|