code: def from_np_datetimes(np_datetimes):
      """Creates DateTensor from a Numpy array of dtype datetime64.
  
      Args:
        np_datetimes: Numpy array of dtype datetime64.
  
      Returns:
        DateTensor object.
  
      #### Example
  
      ```python
      import datetime
      import numpy as np
  
      date_tensor_np = np.array(
        [[datetime.date(2019, 3, 25), datetime.date(2020, 6, 2)],
         [datetime.date(2020, 9, 15), datetime.date(2020, 12, 27)]],
         dtype=np.datetime64)
  
      date_tensor = tff.datetime.dates_from_np_datetimes(date_tensor_np)
      ```
      """
  
      # There's no easy way to extract year, month, day from numpy datetime, so
      # we start with ordinals.
      ordinals = (
          tf.constant(np_datetimes, dtype=tf.int32)
          + _ORDINAL_OF_1_1_1970
      )
      return from_ordinals(ordinals, validate=False)
  
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 4 for calling a global function with example usage: from_np_datetimes(np_datetimes) and returns: from_ordinals