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

Member Details

tensorflow::EnvWrapper::EnvWrapper(Env *t)

Initializes an EnvWrapper that delegates all calls to *t.

virtual tensorflow::EnvWrapper::~EnvWrapper()

Env* tensorflow::EnvWrapper::target() const

Returns the target to which this Env forwards all calls.

Status tensorflow::EnvWrapper::NewRandomAccessFile(const string &f, RandomAccessFile **r) override

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.

Status tensorflow::EnvWrapper::NewWritableFile(const string &f, WritableFile **r) override

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.

Status tensorflow::EnvWrapper::NewAppendableFile(const string &f, WritableFile **r) override

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.

bool tensorflow::EnvWrapper::FileExists(const string &f) override

Returns true iff the named file exists.

Status tensorflow::EnvWrapper::GetChildren(const string &dir, std::vector< string > *r) override

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

Original contents of *results are dropped.

Status tensorflow::EnvWrapper::DeleteFile(const string &f) override

Deletes the named file.

Status tensorflow::EnvWrapper::CreateDir(const string &d) override

Creates the specified directory.

Status tensorflow::EnvWrapper::DeleteDir(const string &d) override

Deletes the specified directory.

Status tensorflow::EnvWrapper::GetFileSize(const string &f, uint64 *s) override

Stores the size of fname in *file_size.

Status tensorflow::EnvWrapper::RenameFile(const string &s, const string &t) override

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

uint64 tensorflow::EnvWrapper::NowMicros() override

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

void tensorflow::EnvWrapper::SleepForMicroseconds(int micros) override

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

Thread* tensorflow::EnvWrapper::StartThread(const ThreadOptions &thread_options, const string &name, std::function< void()> fn) override

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

相关文章
|
1月前
|
数据采集 监控 安全
各种业务场景调用API代理的API接口教程
API代理的API接口在各种业务场景中具有广泛的应用,本文将介绍哪些业务场景可以使用API代理的API接口,并提供详细的调用教程和代码演示,同时,我们还将讨论在不同场景下使用API代理的API接口所带来的好处。
|
4月前
|
API
免费节假日api接口使用教程-聚合数据
免费节假日api接口使用教程-聚合数据
825 0
免费节假日api接口使用教程-聚合数据
|
4月前
|
机器学习/深度学习 JSON JavaScript
图文讲解 Stable Diffusion API 调用教程
Stable Diffusion 是一个先进的深度学习模型,用于创造和修改图像。这个模型能够基于文本描述来生成图像,让机器理解和实现用户的创意。使用这项技术的关键在于掌握其 API,通过编程来操控图像生成的过程。
|
6天前
|
机器学习/深度学习 API TensorFlow
TensorFlow的高级API:tf.keras深度解析
【4月更文挑战第17天】本文深入解析了TensorFlow的高级API `tf.keras`,包括顺序模型和函数式API的模型构建,以及模型编译、训练、评估和预测的步骤。`tf.keras`结合了Keras的易用性和TensorFlow的性能,支持回调函数、模型保存与加载等高级特性,助力提升深度学习开发效率。
|
1月前
|
安全 API 数据安全/隐私保护
email api接口配置教程步骤详解
Email API是用于程序化访问邮件服务的工具,让开发者能集成邮件功能到应用中。配置Email API包括选择供应商(如SendGrid、Mailgun、AokSend),注册获取API密钥,配置API参数,及测试邮件发送。使用Email API能提升邮件发送的可靠性和效率,便于邮件管理及营销活动。AokSend支持大量验证码发送,适合高效邮件运营。
|
2月前
|
存储 负载均衡 API
部署大模型API的实战教程
部署大模型API的实战教程可以分为以下步骤:
|
2月前
|
机器学习/深度学习 人工智能 API
人工智能应用工程师技能提升系列2、——TensorFlow2——keras高级API训练神经网络模型
人工智能应用工程师技能提升系列2、——TensorFlow2——keras高级API训练神经网络模型
33 0
|
4月前
|
存储 API 数据安全/隐私保护
2021年最新最全Flink系列教程__Flink高级API(四)
2021年最新最全Flink系列教程__Flink高级API(四)
36 0
|
4月前
|
消息中间件 API 数据安全/隐私保护
2021年最新最全Flink系列教程__Flink高级API(三)
2021年最新最全Flink系列教程__Flink高级API(三)
17 0
|
4月前
|
消息中间件 Kafka API
2021年最新最全Flink系列教程_Flink原理初探和流批一体API(二.五)
2021年最新最全Flink系列教程_Flink原理初探和流批一体API(二.五)
40 0