tensorflow::TensorShapeUtils

#include <tensor_shape.h>

Static helper routines for TensorShape.

Summary

Includes a few common predicates on a tensor shape.

Public static functions

EndsWith(const TensorShape & shape, const TensorShape & suffix)
bool
Returns true iff shape ends with suffix.
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 & shape, const TensorShape & prefix)
bool
Returns true iff shape starts with prefix.

Public static functions

EndsWith

bool EndsWith(
  const TensorShape & shape,
  const TensorShape & suffix
)

Returns true iff shape ends with suffix.

IsMatrix

bool IsMatrix(
  const TensorShape & shape
)

IsMatrixOrHigher

bool IsMatrixOrHigher(
  const TensorShape & shape
)

IsScalar

bool IsScalar(
  const