Attend the Women in ML Symposium on December 7

# tfp.substrates.numpy.math.fill_triangular_inverse

Stay organized with collections Save and categorize content based on your preferences.

Creates a vector from a (batch of) triangular matrix.

The vector is created from the lower-triangular or upper-triangular portion depending on the value of the parameter `upper`.

If `x.shape` is `[b1, b2, ..., bB, n, n]` then the output shape is `[b1, b2, ..., bB, d]` where `d = n (n + 1) / 2`.

#### Example:

``````fill_triangular_inverse(
[[4, 0, 0],
[6, 5, 0],
[3, 2, 1]])

# ==> [1, 2, 3, 4, 5, 6]

fill_triangular_inverse(
[[1, 2, 3],
[0, 5, 6],
[0, 0, 4]], upper=True)

# ==> [1, 2, 3, 4, 5, 6]
``````

`x` `Tensor` representing lower (or upper) triangular elements.
`upper` Python `bool` representing whether output matrix should be upper triangular (`True`) or lower triangular (`False`, default).
`name` Python `str`. The name to give this op.

`flat_tril` (Batch of) vector-shaped `Tensor` representing vectorized lower (or upper) triangular elements from `x`.

[{ "type": "thumb-down", "id": "missingTheInformationINeed", "label":"Missing the information I need" },{ "type": "thumb-down", "id": "tooComplicatedTooManySteps", "label":"Too complicated / too many steps" },{ "type": "thumb-down", "id": "outOfDate", "label":"Out of date" },{ "type": "thumb-down", "id": "samplesCodeIssue", "label":"Samples / code issue" },{ "type": "thumb-down", "id": "otherDown", "label":"Other" }]
[{ "type": "thumb-up", "id": "easyToUnderstand", "label":"Easy to understand" },{ "type": "thumb-up", "id": "solvedMyProblem", "label":"Solved my problem" },{ "type": "thumb-up", "id": "otherUp", "label":"Other" }]