code: def from_ordinals(ordinals, validate=True):
      """Creates DateTensor from tensors of ordinals.
  
      Args:
        ordinals: Tensor of type int32. Each value is number of days since 1 Jan
          0001. 1 Jan 0001 has `ordinal=1`.
        validate: Whether to validate the dates.
  
      Returns:
        DateTensor object.
  
      #### Example
  
      ```python
      ordinals = tf.constant([
        735703,  # 2015-4-12
        736693   # 2017-12-30
      ], dtype=tf.int32)
  
      date_tensor = tff.datetime.dates_from_ordinals(ordinals)
      ```
      """
      ordinals = tf.convert_to_tensor(ordinals, dtype=tf.int32)
  
      control_deps = []
      if validate:
          control_deps.append(
              tf.debugging.assert_positive(
                  ordinals, message="Ordinals must be positive."
              )
          )
          with tf.compat.v1.control_dependencies(control_deps):
              ordinals = tf.identity(ordinals)
  
      with tf.compat.v1.control_dependencies(control_deps):
          years, months, days = date_utils.ordinal_to_year_month_day(
              ordinals
          )
          return DateTensor(ordinals, years, months, days)
  
imports: import collections.abc
  import datetime
  import numpy
  import tensorflow.compat.v2
  from tf_quant_finance.datetime import constants
  from tf_quant_finance.datetime import date_utils
  from tf_quant_finance.datetime import periods
  from tf_quant_finance.datetime import tensor_wrapper
label_desc: Use image node_id 7 for calling a global function with example usage: from_ordinals(ordinals, validate) and returns: DateTensor