Skip to content

Commit 82098db

Browse files
committed
chore: remove duplicate autograd modules
refactor: remove obsolete autograd shims chore: drop unused autograd wrappers
1 parent 3ebf6b8 commit 82098db

File tree

4 files changed

+0
-420
lines changed

4 files changed

+0
-420
lines changed

tidy3d/web/api/autograd/autograd.py

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from os.path import dirname
66
from pathlib import Path
77

8-
import numpy as np
98
from autograd.builtins import dict as dict_ag
109
from autograd.extend import defvjp, primitive
1110

@@ -47,16 +46,6 @@
4746
)
4847
from .forward import postprocess_fwd as _postprocess_fwd_impl
4948
from .forward import setup_fwd as _setup_fwd_impl
50-
from .io_utils import (
51-
get_vjp_traced_fields as _get_vjp_traced_fields_impl,
52-
)
53-
from .io_utils import (
54-
upload_sim_fields_keys as _upload_sim_fields_keys_impl,
55-
)
56-
57-
# if True, will plot the adjoint fields on the plane provided. used for debugging only
58-
_INSPECT_ADJOINT_FIELDS = False
59-
_INSPECT_ADJOINT_PLANE = td.Box(center=(0, 0, 0), size=(td.inf, td.inf, 0))
6049

6150

6251
def is_valid_for_autograd(simulation: td.Simulation) -> bool:
@@ -623,21 +612,6 @@ def postprocess_fwd(
623612
)
624613

625614

626-
def upload_sim_fields_keys(sim_fields_keys: list[tuple], task_id: str, verbose: bool = False):
627-
"""Upload traced simulation field keys for adjoint runs (delegated)."""
628-
return _upload_sim_fields_keys_impl(
629-
sim_fields_keys=sim_fields_keys, task_id=task_id, verbose=verbose
630-
)
631-
632-
633-
""" VJP maker for ADJ pass."""
634-
635-
636-
def get_vjp_traced_fields(task_id_adj: str, verbose: bool) -> AutogradFieldMap:
637-
"""Fetch VJP traced fields for a completed adjoint job (delegated)."""
638-
return _get_vjp_traced_fields_impl(task_id_adj=task_id_adj, verbose=verbose)
639-
640-
641615
def _run_bwd(
642616
data_fields_original: AutogradFieldMap,
643617
sim_fields_original: AutogradFieldMap,
@@ -919,22 +893,6 @@ def setup_adj(
919893
)
920894

921895

922-
def _compute_eps_array(medium, frequencies):
923-
"""Deprecated shim, kept for backward compatibility; use ops_backward._compute_eps_array."""
924-
from .backward import _compute_eps_array as __impl
925-
926-
return __impl(medium, frequencies)
927-
928-
929-
def _slice_field_data(
930-
field_data: dict, freqs: np.ndarray, component_indicator: typing.Optional[str] = None
931-
) -> dict:
932-
"""Deprecated shim, kept for backward compatibility; use ops_backward._slice_field_data."""
933-
from .backward import _slice_field_data as __impl
934-
935-
return __impl(field_data, freqs, component_indicator)
936-
937-
938896
def postprocess_adj(
939897
sim_data_adj: td.SimulationData,
940898
sim_data_orig: td.SimulationData,

tidy3d/web/api/autograd/constants_local.py

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)