File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -46,7 +46,3 @@ strict = true
4646python_version = " 3.12"
4747warn_return_any = true
4848warn_unused_configs = true
49-
50- [[tool .mypy .overrides ]]
51- module = " tests.*"
52- ignore_errors = true
Original file line number Diff line number Diff line change @@ -49,19 +49,20 @@ def qrt_damping(
4949 return (term1 * term2 ) + term3
5050
5151 # PyTorch Path (Supports Grad Tensors)
52- import torch
52+ if torch is not None :
53+ # Ensure x is a tensor for calling methods
54+ x_t = torch .as_tensor (x )
5355
54- # Ensure x is a tensor for calling methods
55- x_t = torch .as_tensor (x )
56+ term1_t = (x_t * freq_sin ).sin ()
57+ term2_t = (- (x_t ** 2 ) / PHI_FLOAT ).exp ()
58+ term3_t = (x_t * freq_cos ).cos ()
59+ return (term1_t * term2_t ) + term3_t
5660
57- term1_t = (x_t * freq_sin ).sin ()
58- term2_t = (- (x_t ** 2 ) / PHI_FLOAT ).exp ()
59- term3_t = (x_t * freq_cos ).cos ()
60- return (term1_t * term2_t ) + term3_t
61+ raise ImportError ("torch is required for tensor operations but not installed." )
6162
6263
6364def execute_qrt_damping_tensor (
6465 x : Union [np .ndarray , "torch.Tensor" ],
6566) -> Union [np .ndarray , "torch.Tensor" ]:
6667 """Institutional entry-point for QRT manifold damping (Torch/NumPy)."""
67- return qrt_damping (x )
68+ return qrt_damping (x ) # type: ignore[return-value]
You can’t perform that action at this time.
0 commit comments