TensorFlow教程之API DOC 6.1.8 Class tensorflow::TensorShape

本文档为TensorFlow参考文档,本转载已得到TensorFlow中文社区授权。

Class tensorflow::TensorShape

Manages the dimensions of a Tensor and their sizes.

Member Summary

Member Details

tensorflow::TensorShape::TensorShape(gtl::ArraySlice< int64 > dim_sizes)

Construct a TensorShape from the provided sizes. REQUIRES: dim_sizes[i] >= 0

tensorflow::TensorShape::TensorShape(std::initializer_list< int64 > dim_sizes)

tensorflow::TensorShape::TensorShape(const TensorShapeProto &proto)

REQUIRES: IsValid(proto)

tensorflow::TensorShape::TensorShape()

Create a tensor shape with no dimensions and one element, which you can then call AddDim() on.

void tensorflow::TensorShape::Clear()

Clear a tensor shape.

void tensorflow::TensorShape::AddDim(int64 size)

Add a dimension to the end ("inner-most"). REQUIRES: size >= 0

void tensorflow::TensorShape::AppendShape(const TensorShape &shape)

Appends all the dimensions from shape.

void tensorflow::TensorShape::InsertDim(int d, int64 size)

Insert a dimension somewhere in the TensorShape. REQUIRES: 0 <= d <= dims() REQUIRES: size >= 0

void tensorflow::TensorShape::set_dim(int d, int64 size)

Modifies the size of the dimension d to be size REQUIRES: 0 <= d < dims() REQUIRES: size >= 0

void tensorflow::TensorShape::RemoveDim(int d)

Removes dimension d from the TensorShape. REQUIRES: 0 <= d < dims()

int tensorflow::TensorShape::dims() const

Return the number of dimensions in the tensor.

int64 tensorflow::TensorShape::dim_size(int d) const

Returns the number of elements in dimension d. REQUIRES: 0 <= d < dims()

gtl::ArraySlice<int64> tensorflow::TensorShape::dim_sizes() const

Returns sizes of all dimensions.

int64 tensorflow::TensorShape::num_elements() const

Returns the number of elements in the tensor.

We use int64 and not size_t to be compatible with Eigen::Tensor which uses ptrdiff_t.

bool tensorflow::TensorShape::IsSameSize(const TensorShape &b) const

Returns true if *this and b have the same sizes. Ignores dimension names.

bool tensorflow::TensorShape::operator==(const TensorShape &b) const

void tensorflow::TensorShape::AsProto(TensorShapeProto *proto) const

Fill *proto from *this.

Eigen::DSizes< Eigen::DenseIndex, NDIMS > tensorflow::TensorShape::AsEigenDSizes() const

Fill *dsizes from *this.

Eigen::DSizes< Eigen::DenseIndex, NDIMS > tensorflow::TensorShape::AsEigenDSizesWithPadding() const

Same as AsEigenDSizes() but allows for NDIMS > dims() in which case we pad the rest of the sizes with 1.

TensorShapeIter tensorflow::TensorShape::begin() const

For iterating through the dimensions.

TensorShapeIter tensorflow::TensorShape::end() const

string tensorflow::TensorShape::DebugString() const

For error messages.

string tensorflow::TensorShape::ShortDebugString() const

static bool tensorflow::TensorShape::IsValid(const TensorShapeProto &proto)

Returns true iff proto is a valid tensor shape.

时间: 2024-09-10 05:41:24

TensorFlow教程之API DOC 6.1.8 Class tensorflow::TensorShape的相关文章

TensorFlow教程之API DOC 6.1.6 Class tensorflow::Tensor

本文档为TensorFlow参考文档,本转载已得到TensorFlow中文社区授权. Class tensorflow::Tensor Represents an n-dimensional array of values. Member Summary tensorflow::Tensor::Tensor() Default Tensor constructor. Creates a 1-dimension, 0-element float tensor. tensorflow::Tensor

TensorFlow教程之API DOC 6.1.5 Class tensorflow::Status

本文档为TensorFlow参考文档,本转载已得到TensorFlow中文社区授权. Class tensorflow::Status Member Summary tensorflow::Status::Status() Create a success status. tensorflow::Status::~Status() tensorflow::Status::Status(tensorflow::error::Code code, tensorflow::StringPiece ms

TensorFlow教程之API DOC 6.1.7 Class tensorflow::TensorBuffer

本文档为TensorFlow参考文档,本转载已得到TensorFlow中文社区授权. Class tensorflow::TensorBuffer Member Summary tensorflow::TensorBuffer::~TensorBuffer() override virtual void* tensorflow::TensorBuffer::data() const =0 virtual size_t tensorflow::TensorBuffer::size() const

TensorFlow教程之API DOC 6.1.11 Class tensorflow::Thread

本文档为TensorFlow参考文档,本转载已得到TensorFlow中文社区授权. Class tensorflow::Thread Member Summary tensorflow::Thread::Thread() virtual tensorflow::Thread::~Thread() Blocks until the thread of control stops running. Member Details tensorflow::Thread::Thread() virtua

TensorFlow教程之API DOC 6.1.12 Class tensorflow::WritableFile

本文档为TensorFlow参考文档,本转载已得到TensorFlow中文社区授权. Class tensorflow::WritableFile A file abstraction for sequential writing. The implementation must provide buffering since callers may append small fragments at a time to the file. Member Summary tensorflow::

TensorFlow教程之API DOC 6.1.9 Class tensorflow::TensorShapeIter

本文档为TensorFlow参考文档,本转载已得到TensorFlow中文社区授权. Class tensorflow::TensorShapeIter Member Summary tensorflow::TensorShapeIter::TensorShapeIter(const TensorShape *shape, int d) bool tensorflow::TensorShapeIter::operator==(const TensorShapeIter &rhs) bool te

TensorFlow教程之API DOC 6.1.10 Class tensorflow::TensorShapeUtils

本文档为TensorFlow参考文档,本转载已得到TensorFlow中文社区授权. Class tensorflow::TensorShapeUtils Static helper routines for TensorShape. Includes a few common predicates on a tensor shape. Member Summary static bool tensorflow::TensorShapeUtils::IsScalar(const TensorSh

TensorFlow教程之API DOC 6.1.3 Class tensorflow::RandomAccessFile

本文档为TensorFlow参考文档,本转载已得到TensorFlow中文社区授权. Class tensorflow::RandomAccessFile A file abstraction for randomly reading the contents of a file. Member Summary tensorflow::RandomAccessFile::RandomAccessFile() virtual tensorflow::RandomAccessFile::~Rando

TensorFlow教程之API DOC 6.1.13 Struct tensorflow::SessionOptions

本文档为TensorFlow参考文档,本转载已得到TensorFlow中文社区授权. Configuration information for a Session . Member Summary Env* tensorflow::SessionOptions::env The environment to use. string tensorflow::SessionOptions::target The TensorFlow runtime to connect to. ConfigPro