-
Notifications
You must be signed in to change notification settings - Fork 559
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memory leak with TF.function #68
Comments
Hi Arthur, price_eu_options = tf.function(
set_up_pricer(expiries),
input_signature=[tf.TensorSpec([None], dtype=tf.float64),
tf.TensorSpec([], dtype=tf.float64),
tf.TensorSpec([], dtype=tf.float64)]) This ensures that Keep in mind, at the moment XLA compilation expects static shapes. The last time I checked TF recompiles your graph for every shape, meaning you are better off dealing with static shapes Please let me know if this makes sense |
Yes thank you, i didn't know there was a concept of None dimension to handle varying-size inputs. |
https://colab.research.google.com/github/arthurpham/google_colab/blob/e20469359e82ecf96640837e2022f58de0df8314/AmericanOption_MC_MemoryLeak_TQF.ipynb
I've tried to reuse the jupyter notebook that show how to do a MC pricing.
The test is slightly silly but if the application that calls the pricing library might chose to send an arbitrary strike size, so the batch size might not be known in advance, so i'm wondering what is the best way to handle that without asking quants to micromanage the shapes of each inputs (as a change in the shape of one input retrigger the graph construction) ?
Thank you
The text was updated successfully, but these errors were encountered: