날짜를 저장하십시오! Google I / O가 5 월 18 일부터 20 일까지 반환됩니다.

# tensorflow::ops::EditDistance

`#include <array_ops.h>`

Computes the (possibly normalized) Levenshtein Edit Distance.

## Summary

The inputs are variable-length sequences provided by SparseTensors (hypothesis_indices, hypothesis_values, hypothesis_shape) and (truth_indices, truth_values, truth_shape).

The inputs are:

Arguments:

• scope: A Scope object
• hypothesis_indices: The indices of the hypothesis list SparseTensor. This is an N x R int64 matrix.
• hypothesis_values: The values of the hypothesis list SparseTensor. This is an N-length vector.
• hypothesis_shape: The shape of the hypothesis list SparseTensor. This is an R-length vector.
• truth_indices: The indices of the truth list SparseTensor. This is an M x R int64 matrix.
• truth_values: The values of the truth list SparseTensor. This is an M-length vector.
• truth_shape: truth indices, vector.

Optional attributes (see `Attrs`):

• normalize: boolean (if true, edit distances are normalized by length of truth).

The output is:

Returns:

• `Output`: A dense float tensor with rank R - 1.

For the example input:

```// hypothesis represents a 2x1 matrix with variable-length values:
//   (0,0) = ["a"]
//   (1,0) = ["b"]
hypothesis_indices = [[0, 0, 0],
[1, 0, 0]]
hypothesis_values = ["a", "b"]
hypothesis_shape = [2, 1, 1]

// truth represents a 2x2 matrix with variable-length values:
//   (0,0) = []
//   (0,1) = ["a"]
//   (1,0) = ["b", "c"]
//   (1,1) = ["a"]
truth_indices = [[0, 1, 0],
[1, 0, 0],
[1, 0, 1],
[1, 1, 0]]
truth_values = ["a", "b", "c", "a"]
truth_shape = [2, 2, 2]
normalize = true
```

The output will be:

```// output is a 2x2 matrix with edit distances normalized by truth lengths.
output = [[inf, 1.0],  // (0,0): no truth, (0,1): no hypothesis
[0.5, 1.0]]  // (1,0): addition, (1,1): no hypothesis  ```

### Constructors and Destructors

`EditDistance(const ::tensorflow::Scope & scope, ::tensorflow::Input hypothesis_indices, ::tensorflow::Input hypothesis_values, ::tensorflow::Input hypothesis_shape, ::tensorflow::Input truth_indices, ::tensorflow::Input truth_values, ::tensorflow::Input truth_shape)`
`EditDistance(const ::tensorflow::Scope & scope, ::tensorflow::Input hypothesis_indices, ::tensorflow::Input hypothesis_values, ::tensorflow::Input hypothesis_shape, ::tensorflow::Input truth_indices, ::tensorflow::Input truth_values, ::tensorflow::Input truth_shape, const EditDistance::Attrs & attrs)`

### Public attributes

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

### Public functions

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

### Public static functions

`Normalize(bool x)`
`Attrs`

### Structs

tensorflow::ops::EditDistance::Attrs

Optional attribute setters for EditDistance.

## Public attributes

### operation

`Operation operation`

### output

`::tensorflow::Output output`

## Public functions

### EditDistance

``` EditDistance(
const ::tensorflow::Scope & scope,
::tensorflow::Input hypothesis_indices,
::tensorflow::Input hypothesis_values,
::tensorflow::Input hypothesis_shape,
::tensorflow::Input truth_indices,
::tensorflow::Input truth_values,
::tensorflow::Input truth_shape
)```

### EditDistance

``` EditDistance(
const ::tensorflow::Scope & scope,
::tensorflow::Input hypothesis_indices,
::tensorflow::Input hypothesis_values,
::tensorflow::Input hypothesis_shape,
::tensorflow::Input truth_indices,
::tensorflow::Input truth_values,
::tensorflow::Input truth_shape,
const EditDistance::Attrs & attrs
)```

### node

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

### operator::tensorflow::Input

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

### operator::tensorflow::Output

` operator::tensorflow::Output() const `

## Public static functions

### Normalize

```Attrs Normalize(
bool x
)```
[{ "type": "thumb-down", "id": "missingTheInformationINeed", "label":"필요한 정보가 없음" },{ "type": "thumb-down", "id": "tooComplicatedTooManySteps", "label":"너무 복잡함/단계 수가 너무 많음" },{ "type": "thumb-down", "id": "outOfDate", "label":"오래됨" },{ "type": "thumb-down", "id": "samplesCodeIssue", "label":"Samples / code issue" },{ "type": "thumb-down", "id": "otherDown", "label":"기타" }]
[{ "type": "thumb-up", "id": "easyToUnderstand", "label":"이해하기 쉬움" },{ "type": "thumb-up", "id": "solvedMyProblem", "label":"문제가 해결됨" },{ "type": "thumb-up", "id": "otherUp", "label":"기타" }]