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

相关文章
|
4月前
|
人工智能 数据可视化 测试技术
Postman 性能测试教程:快速上手 API 压测
本文介绍API上线后因高频调用导致服务器告警,通过Postman与Apifox进行压力测试排查性能瓶颈。对比两款工具在批量请求、断言验证、可视化报告等方面的优劣,探讨API性能优化策略及行业未来发展方向。
Postman 性能测试教程:快速上手 API 压测
|
6月前
|
JSON 监控 API
在线网络PING接口检测服务器连通状态免费API教程
接口盒子提供免费PING检测API,可测试域名或IP的连通性与响应速度,支持指定地域节点,适用于服务器运维和网络监控。
688 0
|
6月前
|
JSON API PHP
通用图片搜索API:百度源免费接口教程
本文介绍一款基于百度图片搜索的免费API接口,由接口盒子提供。支持关键词搜索,具备详细请求与返回参数说明,并提供PHP及Python调用示例。开发者可快速集成实现图片搜索功能,适用于内容聚合、素材库建设等场景。
915 0
|
6月前
|
JSON 机器人 API
随机昵称网名API接口教程:轻松获取百万创意昵称库
接口盒子提供随机昵称网名API,拥有百万级中文昵称库,支持聊天机器人、游戏角色等场景的昵称生成。提供详细调用指南及多语言示例代码,助力开发者高效集成。
618 0
|
4月前
|
人工智能 API 开发者
图文教程:阿里云百炼API-KEY获取方法,亲测全流程
本文详细介绍了如何获取阿里云百炼API-KEY,包含完整流程与截图指引。需先开通百炼平台及大模型服务,再通过控制台创建并复制API-KEY。目前平台提供千万tokens免费额度,适合开发者快速上手使用。
3605 5
|
6月前
|
JSON API PHP
天气预报免费API接口【地址查询版】使用教程
本文介绍了如何使用中国气象局官方数据提供的免费天气预报API接口,通过省份和地点查询指定地区当日天气信息。该接口由接口盒子支持,提供JSON格式数据、GET/POST请求方式,并需注册获取用户ID和KEY进行身份验证。
3760 2
|
6月前
|
JSON API PHP
ICP备案查询免费API接口使用教程
本文介绍如何通过接口盒子提供的免费API接口查询域名ICP备案信息,包含请求地址、参数说明及PHP和Python调用示例,适用于开发者快速集成备案查询功能。
522 1
|
6月前
|
存储 JSON API
文本存储免费API接口教程
接口盒子提供免费文本存储服务,支持1000条记录,每条最多5000字符,适用于公告、日志、配置等场景,支持修改与读取。
212 0
|
6月前
|
数据采集 JSON 监控
获取网页状态码(可指定地域)免费API接口教程
本文介绍如何使用接口盒子的免费API获取网页状态码,支持国内、香港、美国等不同地域访问节点。内容包括接口参数、调用方法及示例,适用于网站监控、链接检查等场景。
463 0
|
6月前
|
JSON 物联网 API
天气预报免费API接口【IP查询版】使用教程
IP查询天气API是一款免费实用的接口,可根据IP地址自动获取所在地天气预报,支持自定义IP查询。核心功能包括自动识别请求IP、全国IP天气查询,数据源自中国气象局,无日调用上限。提供详细的返回参数及多语言示例代码,适用于网站、APP、物联网设备等应用场景。
1442 0