Help protect the Great Barrier Reef with TensorFlow on Kaggle

# tensorflow::ops::Diag

`#include <array_ops.h>`

Returns a diagonal tensor with a given diagonal values.

## Summary

Given a `diagonal`, this operation returns a tensor with the `diagonal` and everything else padded with zeros. The diagonal is computed as follows:

Assume `diagonal` has dimensions [D1,..., Dk], then the output is a tensor of rank 2k with dimensions [D1,..., Dk, D1,..., Dk] where:

`output[i1,..., ik, i1,..., ik] = diagonal[i1, ..., ik]` and 0 everywhere else.

For example:

```# 'diagonal' is [1, 2, 3, 4]
tf.diag(diagonal) ==> [[1, 0, 0, 0]
[0, 2, 0, 0]
[0, 0, 3, 0]
[0, 0, 0, 4]]
```

Arguments:

• scope: A Scope object
• diagonal: Rank k tensor where k is at most 1.

Returns:

• `Output`: The output tensor.

### Constructors and Destructors

`Diag(const ::tensorflow::Scope & scope, ::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

### Diag

``` Diag(
const ::tensorflow::Scope & scope,
::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":"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" }]