code: def _get_all_iv(
      dim,
      expiry_times,
      strikes,
      spot,
      paths,
      iv,
      iv_start_index,
      discount_factor_fn,
      dtype,
  ):
      num_times = expiry_times[0].shape[0]
      sim_iv = dim * [
          num_times * [(len(iv[0][0]) - iv_start_index) * [0]]
      ]
      for d in range(dim):
          for i in range(num_times):
              for j in range(iv_start_index, len(iv[0][0])):
                  sim_iv[d][i][j - iv_start_index] = _get_implied_vol(
                      expiry_times[d][i],
                      strikes[d][i][j],
                      paths[:, i, d],
                      spot[d],
                      discount_factor_fn,
                      dtype,
                  )[0]
      return sim_iv
  
imports: import functools
  from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v2
  import tf_quant_finance
  from tf_quant_finance.experimental.local_volatility import local_volatility_model
  from tensorflow.python.framework import test_util
label_desc: Use image node_id 5 for calling a global function with example usage: _get_all_iv(dim, expiry_times, strikes, spot, paths, iv, iv_start_index, discount_factor_fn, dtype) and returns: sim_iv