tensorflow::TensorShapeUtils

#include <tensor_shape.h>

Static helper routines for TensorShape.

Summary

Includes a few common predicates on a tensor shape.

Public static functions

IsMatrix(const TensorShape & shape)
bool
IsMatrixOrHigher(const TensorShape & shape)
bool
IsScalar(const TensorShape & shape)
bool
IsSquareMatrix(const TensorShape & shape)
bool
IsVector(const TensorShape & shape)
bool
IsVectorOrHigher(const TensorShape & shape)
bool
MakeShape(const int32 *dims, int64 n, TensorShape *out)
Returns a TensorShape whose dimensions are dims[0], dims[1], ..., dims[n-1].
MakeShape(const int64 *dims, int64 n, TensorShape *out)
MakeShape(gtl::ArraySlice< int32 > shape, TensorShape *out)
MakeShape(gtl::ArraySlice< int64 > shape, TensorShape *out)
ShapeListString(const gtl::ArraySlice< TensorShape > & shapes)
string
StartsWith(const TensorShape & shape0, const TensorShape & shape1)
bool

Public static functions

IsMatrix

bool IsMatrix(
  const TensorShape & shape
)

IsMatrixOrHigher

bool IsMatrixOrHigher(
  const TensorShape & shape
)

IsScalar

bool IsScalar(
  const TensorShape & shape
)

IsSquareMatrix

bool IsSquareMatrix(
  const TensorShape & shape
)

IsVector

bool IsVector(
  const TensorShape & shape
)

IsVectorOrHigher

bool IsVectorOrHigher(
  const TensorShape & shape
)

MakeShape

Status MakeShape(
  const int32 *dims,
  int64 n,
  TensorShape *out
)

Returns a TensorShape whose dimensions are dims[0], dims[1], ..., dims[n-1].

MakeShape

Status MakeShape(
  const int64 *dims,
  int64 n,
  TensorShape *out
)

MakeShape

Status MakeShape(
  gtl::ArraySlice< int32 > shape,
  TensorShape *out
)

MakeShape

Status MakeShape(
  gtl::ArraySlice< int64 > shape,
  TensorShape *out
)

ShapeListString

string ShapeListString(
  const gtl::ArraySlice< TensorShape > & shapes
)

StartsWith

bool StartsWith(
  const TensorShape & shape0,
  const TensorShape & shape1
)