<!--
This file is generated by a tool. Do not edit directly.
For open-source contributions the docs will be updated automatically.
-->

*Last updated: 2023-03-16.*

<div itemscope itemtype="http://developers.google.com/ReferenceObject">
<meta itemprop="name" content="tf_quant_finance.math.pad.pad_date_tensors" />
<meta itemprop="path" content="Stable" />
</div>

# tf_quant_finance.math.pad.pad_date_tensors

<!-- Insert buttons and diff -->

<table class="tfo-notebook-buttons tfo-api" align="left">
</table>

<a target="_blank" href="https://github.com/paolodelia99/tf-quant-finance/blob/main/tf_quant_finance/math/pad.py">View source</a>



Pads the innermost dimension of `DateTensor`s to a common shape.

```python
tf_quant_finance.math.pad.pad_date_tensors(
    date_tensors, name=None
)
```



<!-- Placeholder for "Used in" -->

Given a list of `DateTensor`s of shapes `batch_shape_i + [n_i]`, pads the
innermost dimension of each corresponding ordinal tensor to
`batch_shape_i + [max(n_i)]`. For each ordinal tensor `t`, the padding is done
with values `t[..., -1]`.

### Example
```python
x = [(2020, 1, 1), (2021, 2, 2)]
y = [(2019, 5, 5), (2028, 10, 21), (2028, 11, 10)]
pad_date_tensors([x, y])
# Expected: [DateTensor: [(2020, 1, 1), (2021, 2, 2), (2021, 2, 2)],
#            DateTensor: [(2019, 5, 5), (2028, 10, 21), (2028, 11, 10)]]
```

#### Args:


* <b>`date_tensors`</b>: a list of tensors of shapes `batch_shape_i + [n_i]`.
* <b>`name`</b>: Python string. The name to give to the ops created by this class.
  Default value: `None` which maps to the default name `pad_date_tensors`.

#### Returns:

A list of `DateTensor`s of shape `batch_shape_i + [max(n_i)]`.
