code: def build_surface(dim, default_interp=True):
      dtype = tf.float64
      year = dim * [[2021, 2022, 2023, 2025, 2050]]
      month = dim * [[2, 2, 2, 2, 2]]
      day = dim * [[8, 8, 8, 8, 8]]
      expiries = tff.datetime.dates_from_year_month_day(
          year, month, day
      )
      valuation_date = [(2020, 6, 24)]
      strikes = dim * [
          [
              [1500, 1550, 1510],
              [1500, 1550, 1510],
              [1500, 1550, 1510],
              [1500, 1550, 1510],
              [1500, 1550, 1510],
          ]
      ]
      volatilities = dim * [
          [
              [0.1, 0.12, 0.13],
              [0.15, 0.2, 0.15],
              [0.1, 0.2, 0.1],
              [0.1, 0.2, 0.1],
              [0.1, 0.1, 0.3],
          ]
      ]
      interpolator = None
      if not default_interp:
          expiry_times = (
              tf.cast(
                  tff.datetime.convert_to_date_tensor(
                      valuation_date
                  ).days_until(expiries),
                  dtype=dtype,
              )
              / 365.0
          )
          interpolator_obj = (
              tff.math.interpolation.interpolation_2d.Interpolation2D(
                  expiry_times,
                  tf.convert_to_tensor(strikes, dtype=dtype),
                  volatilities,
              )
          )
          interpolator = interpolator_obj.interpolate
  
      return volatility_surface.VolatilitySurface(
          valuation_date,
          expiries,
          strikes,
          volatilities,
          interpolator=interpolator,
          dtype=dtype,
      )
  
file_path: tf-quant-finance/tf_quant_finance/experimental/pricing_platform/framework/market_data/volatility_surface_test.py
imports: from absl.testing import parameterized
  import tensorflow.compat.v2
  import tf_quant_finance
  from tensorflow.python.framework import test_util
label_desc: Use image node_id 1 for calling a global function with example usage: build_surface(dim, default_interp) and returns: volatility_surface