Several of the unit tests in test_adjoint_solve.py are failing due to an error related to autograd. See below for output from the test logs. I think this could be due to the recent changes made to the adjoint filters in #2465 and #2518.
Since there does not seem to have been any significant functional changes to autograd recently, it's not clear why these errors were not triggered in the Github CI.
____________________ TestAdjointSolver.test_periodic_design ____________________
> solid_grad = grad(mpa.constraint_solid, 0)(
p,
c,
eta_e,
filter_f,
threshold_f,
self.design_region_resolution,
periodic_axes,
)
tests/test_adjoint_solver.py:999:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../autograd/wrap_util.py:20: in nary_f
return unary_operator(unary_f, x, *nary_op_args, **nary_op_kwargs)
../autograd/differential_operators.py:29: in grad
return vjp(vspace(ans).ones())
../autograd/core.py:14: in vjp
def vjp(g): return backward_pass(g, end_node)
../autograd/core.py:21: in backward_pass
ingrads = node.vjp(outgrad[0])
../autograd/core.py:67: in <lambda>
return lambda g: (vjp(g),)
../autograd/numpy/fft.py:17: in <lambda>
return lambda g: match_complex(x, truncate_pad(fft_fun(g, *args, **kwargs), vs.shape))
../autograd/tracer.py:48: in f_wrapped
return f_raw(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
x = array([[-1.28056837e-07+0.00000000e+00j, 1.13440917e-07-6.88609116e-09j,
-7.57466336e-08+1.16364222e-08j, .......,
-2.43666044e-10+9.31947518e-10j, -5.38423198e-09-5.29486095e-09j,
8.57666150e-09+9.03418206e-09j]])
shape = (91, 273)
@primitive
def truncate_pad(x, shape):
# truncate/pad x to have the appropriate shape
slices = [slice(n) for n in shape]
pads = list(zip(anp.zeros(len(shape), dtype=int),
anp.maximum(0, anp.array(shape) - anp.array(x.shape))))
> return anp.pad(x, pads, 'constant')[slices]
E IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices
../autograd/numpy/fft.py:101: IndexError
Several of the unit tests in
test_adjoint_solve.py
are failing due to an error related to autograd. See below for output from the test logs. I think this could be due to the recent changes made to the adjoint filters in #2465 and #2518.Since there does not seem to have been any significant functional changes to autograd recently, it's not clear why these errors were not triggered in the Github CI.