We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent de14f6c commit 12b6fa4Copy full SHA for 12b6fa4
1 file changed
diffct/differentiable.py
@@ -2,6 +2,7 @@
2
import numpy as np
3
import torch
4
from numba import cuda
5
+from functools import lru_cache
6
7
# ---------------------------------------------------------------------------
8
# Global settings & helpers
@@ -110,6 +111,7 @@ def tensor_to_cuda_array(tensor):
110
111
112
113
# === GPU-aware Trigonometric Table Generation ===
114
+@lru_cache(maxsize=2048)
115
def _trig_tables(angles, dtype=_DTYPE, device=None):
116
"""Compute cosine and sine tables for input angles.
117
0 commit comments