Join us at TensorFlow World, Oct 28-31. Use code TF20 for 20% off select passes. Register now

tensorflow::ops::StringLength

#include <string_ops.h>

String lengths of input.

Summary

Computes the length of each string given in the input tensor.

Arguments:

  • scope: A Scope object
  • input: The string for which to compute the length.

Optional attributes (see Attrs):

  • unit: The unit that is counted to compute string length. One of: "BYTE" (for the number of bytes in each string) or "UTF8_CHAR" (for the number of UTF-8 encoded Unicode code points in each string). Results are undefined if unit=UTF8_CHAR and the input strings do not contain structurally valid UTF-8.

Returns:

  • Output: Integer tensor that has the same shape as input. The output contains the element-wise string lengths of input.

Constructors and Destructors

StringLength(const ::tensorflow::Scope & scope, ::tensorflow::Input input)
StringLength(const ::tensorflow::Scope & scope, ::tensorflow::Input input, const StringLength::Attrs & attrs)

Public attributes

operation
output

Public functions

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

Public static functions

Unit(StringPiece x)

Structs

tensorflow::ops::StringLength::Attrs

Optional attribute setters for StringLength.

Public attributes

operation

Operation operation

output

::tensorflow::Output output

Public functions

StringLength

 StringLength(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input input
)

StringLength

 StringLength(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input input,
  const StringLength::Attrs & attrs
)

node

::tensorflow::Node * node() const 

operator::tensorflow::Input

 operator::tensorflow::Input() const 

operator::tensorflow::Output

 operator::tensorflow::Output() const 

Public static functions

Unit

Attrs Unit(
  StringPiece x
)