TensorFlow教程之API DOC 6.1.1Class tensorflow::Env

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

Class tensorflow::Env

An interface used by the tensorflow implementation to access operating system functionality like the filesystem etc.

Callers may wish to provide a custom Env object to get fine grain control.

All Env implementations are safe for concurrent access from multiple threads without any external synchronization.

Member Summary

Member Details

tensorflow::Env::Env()

virtual tensorflow::Env::~Env()

virtual Status tensorflow::Env::NewRandomAccessFile(const string &fname, RandomAccessFile **result)=0

Creates a brand new random access read-only file with the specified name.

On success, stores a pointer to the new file in result and returns OK. On failure stores NULL in result and returns non-OK. If the file does not exist, returns a non-OK status.

The returned file may be concurrently accessed by multiple threads.

virtual Status tensorflow::Env::NewWritableFile(const string &fname, WritableFile **result)=0

Creates an object that writes to a new file with the specified name.

Deletes any existing file with the same name and creates a new file. On success, stores a pointer to the new file in result and returns OK. On failure stores NULL in result and returns non-OK.

The returned file will only be accessed by one thread at a time.

virtual Status tensorflow::Env::NewAppendableFile(const string &fname, WritableFile **result)=0

Creates an object that either appends to an existing file, or writes to a new file (if the file does not exist to begin with).

On success, stores a pointer to the new file in result and returns OK. On failure stores NULL in result and returns non-OK.

The returned file will only be accessed by one thread at a time.

virtual bool tensorflow::Env::FileExists(const string &fname)=0

Returns true iff the named file exists.

virtual Status tensorflow::Env::GetChildren(const string &dir, std::vector< string > *result)=0

Stores in *result the names of the children of the specified directory. The names are relative to "dir".

Original contents of *results are dropped.

virtual Status tensorflow::Env::DeleteFile(const string &fname)=0

Deletes the named file.

virtual Status tensorflow::Env::CreateDir(const string &dirname)=0

Creates the specified directory.

virtual Status tensorflow::Env::DeleteDir(const string &dirname)=0

Deletes the specified directory.

virtual Status tensorflow::Env::GetFileSize(const string &fname, uint64 *file_size)=0

Stores the size of fname in *file_size.

virtual Status tensorflow::Env::RenameFile(const string &src, const string &target)=0

Renames file src to target. If target already exists, it will be replaced.

virtual uint64 tensorflow::Env::NowMicros()=0

Returns the number of micro-seconds since some fixed point in time. Only useful for computing deltas of time.

virtual void tensorflow::Env::SleepForMicroseconds(int micros)=0

Sleeps/delays the thread for the prescribed number of micro-seconds.

virtual Thread* tensorflow::Env::StartThread(const ThreadOptions &thread_options, const string &name, std::function< void()> fn) TF_MUST_USE_RESULT=0

Returns a new thread that is running fn() and is identified (for debugging/performance-analysis) by "name".

Caller takes ownership of the result and must delete it eventually (the deletion will block until fn() stops running).

static Env* tensorflow::Env::Default()

Returns a default environment suitable for the current operating system.

Sophisticated users may wish to provide their own Env implementation instead of relying on this default environment.

The result of Default() belongs to this library and must never be deleted.

时间: 2024-11-05 04:56:35

TensorFlow教程之API DOC 6.1.1Class tensorflow::Env的相关文章

TensorFlow教程之API DOC 6.1.17 TensorFlow C++ Session API reference documentation

本文档为TensorFlow参考文档,本转载已得到TensorFlow中文社区授权. TensorFlow C++ Session API reference documentation TensorFlow's public C++ API includes only the API for executing graphs, as of version 0.5. To control the execution of a graph from C++: Build the computati

TensorFlow教程之API DOC 6.1.2Class tensorflow::EnvWrapper

本文档为TensorFlow参考文档,本转载已得到TensorFlow中文社区授权. Class tensorflow::EnvWrapper An implementation of Env that forwards all calls to another Env . May be useful to clients who wish to override just part of the functionality of another Env . Member Summary ten

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.8 Class tensorflow::TensorShape

本文档为TensorFlow参考文档,本转载已得到TensorFlow中文社区授权. Class tensorflow::TensorShape Manages the dimensions of a Tensor and their sizes. Member Summary tensorflow::TensorShape::TensorShape(gtl::ArraySlice< int64 > dim_sizes) Construct a TensorShape from the pro

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.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.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

TensorFlow教程之API DOC 6.1.15 Struct tensorflow::TensorShapeDim

本文档为TensorFlow参考文档,本转载已得到TensorFlow中文社区授权. Struct tensorflow::TensorShapeDim Member Summary int tensorflow::TensorShapeDim::size tensorflow::TensorShapeDim::TensorShapeDim(int64 s) Member Details int tensorflow::TensorShapeDim::size tensorflow::Tenso