¿Tengo una pregunta? Conéctese con la comunidad en el Foro de TensorFlow

# tensorflow:: ops:: MatrixSetDiag

``` #include <array_ops.h> ```

Returns a batched matrix tensor with new batched diagonal values.

## Summary

Given ``` input ``` and ``` diagonal ``` , this operation returns a tensor with the same shape and values as ``` input ``` , except for the main diagonal of the innermost matrices. These will be overwritten by the values in ``` diagonal ``` .

The output is computed as follows:

Assume ``` input ``` has ``` k+1 ``` dimensions ``` [I, J, K, ..., M, N] ``` and ``` diagonal ``` has ``` k ``` dimensions ``` [I, J, K, ..., min(M, N)] ``` . Then the output is a tensor of rank ``` k+1 ``` with dimensions ``` [I, J, K, ..., M, N] ``` where:

• ``` output[i, j, k, ..., m, n] = diagonal[i, j, k, ..., n] ``` for ``` m == n ``` .
• ``` output[i, j, k, ..., m, n] = input[i, j, k, ..., m, n] ``` for ``` m != n ``` .

Args:

• scope: A Scope object
• input: Rank ``` k+1 ``` , where ``` k >= 1 ``` .
• diagonal: Rank ``` k ``` , where ``` k >= 1 ``` .

Returns:

• ``` Output ``` : Rank ``` k+1 ``` , with ``` output.shape = input.shape ``` .

### Constructors and Destructors

``` MatrixSetDiag (const :: tensorflow::Scope & scope, :: tensorflow::Input input, :: tensorflow::Input diagonal) ```

### Public attributes

``` operation ```
``` Operation ```
``` output ```
``` :: tensorflow::Output ```

### Public functions

``` node () const ```
``` ::tensorflow::Node * ```
``` operator::tensorflow::Input () const ```
``` ```
``` operator::tensorflow::Output () const ```
``` ```

## Public attributes

### operation

`Operation operation`

### output

`::tensorflow::Output output`

## Public functions

### MatrixSetDiag

``` MatrixSetDiag(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input diagonal
)```

### node

`::tensorflow::Node * node() const `

### operator::tensorflow::Input

` operator::tensorflow::Input() const `

### operator::tensorflow::Output

` operator::tensorflow::Output() const `
[{ "type": "thumb-down", "id": "missingTheInformationINeed", "label":"Falta la información que necesito" },{ "type": "thumb-down", "id": "tooComplicatedTooManySteps", "label":"Muy complicado o demasiados pasos" },{ "type": "thumb-down", "id": "outOfDate", "label":"Desactualizado" },{ "type": "thumb-down", "id": "samplesCodeIssue", "label":"Samples / code issue" },{ "type": "thumb-down", "id": "otherDown", "label":"Otro" }]
[{ "type": "thumb-up", "id": "easyToUnderstand", "label":"Fácil de comprender" },{ "type": "thumb-up", "id": "solvedMyProblem", "label":"Resolvió mi problema" },{ "type": "thumb-up", "id": "otherUp", "label":"Otro" }]