class_docstr: Represents a tensor of dates.
class_docstr_tok: ["Represents","a","tensor","of","dates","."]
docstr: Packs the dates into a single Tensor.
  
  The Tensor has shape `date_tensor.shape() + (3,)`, where the last dimension
  represents years, months and days, in this order.
  
  This can be convenient when the dates are the final result of a computation
  in the graph mode: a `tf.function` can return `date_tensor.to_tensor()`, or,
  if one uses `tf.compat.v1.Session`, they can call
  `session.run(date_tensor.to_tensor())`.
  
  Returns:
    A Tensor of shape `date_tensor.shape() + (3,)`.
  
  #### Example
  
  ```python
  dates = tff.datetime.dates_from_tuples([(2019, 1, 25), (2020, 3, 2)])
  dates.to_tensor()  # tf.Tensor with contents [[2019, 1, 25], [2020, 3, 2]].
  ```
code: def to_tensor(self):
      """Packs the dates into a single Tensor.
  
      The Tensor has shape `date_tensor.shape() + (3,)`, where the last dimension
      represents years, months and days, in this order.
  
      This can be convenient when the dates are the final result of a computation
      in the graph mode: a `tf.function` can return `date_tensor.to_tensor()`, or,
      if one uses `tf.compat.v1.Session`, they can call
      `session.run(date_tensor.to_tensor())`.
  
      Returns:
        A Tensor of shape `date_tensor.shape() + (3,)`.
  
      #### Example
  
      ```python
      dates = tff.datetime.dates_from_tuples([(2019, 1, 25), (2020, 3, 2)])
      dates.to_tensor()  # tf.Tensor with contents [[2019, 1, 25], [2020, 3, 2]].
      ```
      """
      return tf.stack((self.year(), self.month(), self.day()), axis=-1)
  
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 the DateTensor obj's underlying member method code with example usage: obj.to_tensor() and returns: tf