Possible to save compiled GradientTape after compile in ReverseDiff

xxxxx
Tue, 07 Mar 2023 20:50:56 +0000
Optimization (Mathematical)

Hi,

I was wondering if it would be possible to save the compiled GradientTape that is used in ReverseDiff.jl.

Using the gradient example from the package, I’d like to save

compiled_f_tape

# some objective function to work with
f(a, b) = sum(a' * b + a * b')

# pre-record a GradientTape for `f` using inputs of shape 100x100 with Float64 elements
const f_tape = GradientTape(f, (rand(100, 100), rand(100, 100)))

# compile `f_tape` into a more optimized representation
const compiled_f_tape = compile(f_tape)

Thank you for your help!

9 posts - 2 participants