google / tf-quant-finance

High-performance TensorFlow library for quantitative finance.
Apache License 2.0
4.48k stars 571 forks source link

times grid bug (XLA) #81

Open a17brah opened 1 year ago

a17brah commented 1 year ago

Hi,

I noticed a problem with the time grid in euler_sample when XLA compilation (with dynamic shape for times) is used.

image

https://colab.research.google.com/drive/1kg8RChmJ3TxdONBHE1lIdCAmZKIXwGcY#scrollTo=pohADCcoTZMh

Thank you

cyrilchim commented 1 year ago

Hi,

Thanks for reporting. This is related to the way XLA deals with dynamic shapes. I'll update once fixed. You can use num_time_steps instead of time_step in process.sample_paths for now.

Cyril