class_docstr: Prices options using TFF.
class_docstr_tok: ["Prices","options","using","TFF","."]
code: def __init__(self, batch_size=1000000, num_assets=1000):
      dtype = np.float64
      self._pricer = tf.function(_price)
      # Do a warm-up. This initializes a bunch of stuff which improves performance
      # at request serving time.
      if batch_size is not None and num_assets is not None:
          self._pricer(
              np.zeros([num_assets], dtype=dtype),  # spot_mkt
              np.zeros([num_assets], dtype=dtype),  # vol_mkt
              np.zeros([num_assets], dtype=dtype),  # rate_mkt
              np.zeros([batch_size], dtype=np.int32),  # underliers
              np.zeros([batch_size], dtype=dtype),  # strikes
              np.zeros([batch_size], dtype=bool),  # call_put_flag
              np.ones([batch_size], dtype=np.int32),
          )
  
file_path: tf-quant-finance/tf_quant_finance/examples/demos/option_pricing_basic/pricer/app/pricers.py
imports: import datetime
  import time
  import numpy
  import tensorflow
  import tf_quant_finance
label_desc: Use image node_id 1 to create a new TffOptionPricer object  with example: obj = TffOptionPricer(batch_size, num_assets)