I have a decoder function which contains a subfunction that runs an iterative summation across an input 2D Tensor and an 2xn shaped variable. This summation function works properly during training, however the variables that are used in the function - the 2xn shaped variable and a possible bias term - are not being saved in any of the model checkpoints. Thus, when I load a model for decoding, the function fails as the variables are not in the checkpoint. I tried moving the function out and using it as a normal function, and still didn't see the variables in the checkpoint.
I suspect it could be a problem with the default save scope in saver.save()