@Namespace(value="tensorflow::ops") @NoOffset @Properties(inherit=tensorflow.class) public class EditDistance extends Pointer
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 hypothesisModifier and Type | Class and Description |
---|---|
static class |
EditDistance.Attrs
Optional attribute setters for EditDistance
|
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter
Constructor and Description |
---|
EditDistance(Pointer p)
Pointer cast constructor.
|
EditDistance(Scope scope,
Input hypothesis_indices,
Input hypothesis_values,
Input hypothesis_shape,
Input truth_indices,
Input truth_values,
Input truth_shape) |
EditDistance(Scope scope,
Input hypothesis_indices,
Input hypothesis_values,
Input hypothesis_shape,
Input truth_indices,
Input truth_values,
Input truth_shape,
EditDistance.Attrs attrs) |
Modifier and Type | Method and Description |
---|---|
Input |
asInput() |
Output |
asOutput() |
Node |
node() |
static EditDistance.Attrs |
Normalize(boolean x) |
Operation |
operation() |
EditDistance |
operation(Operation setter) |
Output |
output() |
EditDistance |
output(Output setter) |
address, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, getDirectBufferAddress, getPointer, getPointer, getPointer, getPointer, hashCode, interruptDeallocatorThread, isNull, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetAddress, offsetof, offsetof, parseBytes, physicalBytes, physicalBytesInaccurate, position, position, put, realloc, referenceCount, releaseReference, retainReference, setNull, sizeof, sizeof, toString, totalBytes, totalCount, totalPhysicalBytes, withDeallocator, zero
public EditDistance(Pointer p)
Pointer(Pointer)
.public EditDistance(@Const @ByRef Scope scope, @ByVal Input hypothesis_indices, @ByVal Input hypothesis_values, @ByVal Input hypothesis_shape, @ByVal Input truth_indices, @ByVal Input truth_values, @ByVal Input truth_shape)
public Node node()
@ByVal public static EditDistance.Attrs Normalize(@Cast(value="bool") boolean x)
public EditDistance operation(Operation setter)
public EditDistance output(Output setter)
Copyright © 2022. All rights reserved.