Skip to content

Commit

Permalink
Run C++ gendocs (#1905)
Browse files Browse the repository at this point in the history
  • Loading branch information
martinwicke committed Apr 13, 2016
1 parent f819d48 commit 8dc5ede
Show file tree
Hide file tree
Showing 10 changed files with 121 additions and 139 deletions.
56 changes: 45 additions & 11 deletions tensorflow/g3doc/api_docs/cc/ClassEnv.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,73 +14,107 @@ All Env implementations are safe for concurrent access from multiple threads wit



#### `tensorflow::Env::~Env()` {#tensorflow_Env_Env}
#### `virtual tensorflow::Env::~Env()=default` {#virtual_tensorflow_Env_Env}





#### `virtual Status tensorflow::Env::NewRandomAccessFile(const string &fname, RandomAccessFile **result)=0` {#virtual_Status_tensorflow_Env_NewRandomAccessFile}
#### `Status tensorflow::Env::GetFileSystemForFile(const string &fname, FileSystem **result)` {#Status_tensorflow_Env_GetFileSystemForFile}

Returns the FileSystem object to handle operations on the file specified by 'fname'. The FileSystem object is used as the implementation for the file system related (non-virtual) functions that follow. Returned FileSystem object is still owned by the Env object and will.



#### `Status tensorflow::Env::GetRegisteredFileSystemSchemes(std::vector< string > *schemes)` {#Status_tensorflow_Env_GetRegisteredFileSystemSchemes}

Returns the file system schemes registered for this Env .



#### `void tensorflow::Env::RegisterFileSystem(const string &scheme, FileSystemRegistry::Factory factory)` {#void_tensorflow_Env_RegisterFileSystem}





#### `Status tensorflow::Env::NewRandomAccessFile(const string &fname, RandomAccessFile **result)` {#Status_tensorflow_Env_NewRandomAccessFile}

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` {#virtual_Status_tensorflow_Env_NewWritableFile}
The ownership of the returned RandomAccessFile is passed to the caller and the object should be deleted when is not used. The file object shouldn&apos;t live longer than the Env object.

#### `Status tensorflow::Env::NewWritableFile(const string &fname, WritableFile **result)` {#Status_tensorflow_Env_NewWritableFile}

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` {#virtual_Status_tensorflow_Env_NewAppendableFile}
The ownership of the returned WritableFile is passed to the caller and the object should be deleted when is not used. The file object shouldn&apos;t live longer than the Env object.

#### `Status tensorflow::Env::NewAppendableFile(const string &fname, WritableFile **result)` {#Status_tensorflow_Env_NewAppendableFile}

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` {#virtual_bool_tensorflow_Env_FileExists}
The ownership of the returned WritableFile is passed to the caller and the object should be deleted when is not used. The file object shouldn&apos;t live longer than the Env object.

#### `Status tensorflow::Env::NewReadOnlyMemoryRegionFromFile(const string &fname, ReadOnlyMemoryRegion **result)` {#Status_tensorflow_Env_NewReadOnlyMemoryRegionFromFile}

Creates a readonly region of memory with the file context.

On success, it returns a pointer to read-only memory region from the content of file fname. The ownership of the region is passed to the caller. On failure stores nullptr in *result and returns non-OK.

The returned memory region can be accessed from many threads in parallel.

The ownership of the returned ReadOnlyMemoryRegion is passed to the caller and the object should be deleted when is not used. The memory region object shouldn&apos;t live longer than the Env object.

#### `bool tensorflow::Env::FileExists(const string &fname)` {#bool_tensorflow_Env_FileExists}

Returns true iff the named file exists.



#### `virtual Status tensorflow::Env::GetChildren(const string &dir, std::vector< string > *result)=0` {#virtual_Status_tensorflow_Env_GetChildren}
#### `Status tensorflow::Env::GetChildren(const string &dir, std::vector< string > *result)` {#Status_tensorflow_Env_GetChildren}

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` {#virtual_Status_tensorflow_Env_DeleteFile}
#### `Status tensorflow::Env::DeleteFile(const string &fname)` {#Status_tensorflow_Env_DeleteFile}

Deletes the named file.



#### `virtual Status tensorflow::Env::CreateDir(const string &dirname)=0` {#virtual_Status_tensorflow_Env_CreateDir}
#### `Status tensorflow::Env::CreateDir(const string &dirname)` {#Status_tensorflow_Env_CreateDir}

Creates the specified directory.



#### `virtual Status tensorflow::Env::DeleteDir(const string &dirname)=0` {#virtual_Status_tensorflow_Env_DeleteDir}
#### `Status tensorflow::Env::DeleteDir(const string &dirname)` {#Status_tensorflow_Env_DeleteDir}

Deletes the specified directory.



#### `virtual Status tensorflow::Env::GetFileSize(const string &fname, uint64 *file_size)=0` {#virtual_Status_tensorflow_Env_GetFileSize}
#### `Status tensorflow::Env::GetFileSize(const string &fname, uint64 *file_size)` {#Status_tensorflow_Env_GetFileSize}

Stores the size of `fname` in `*file_size`.



#### `virtual Status tensorflow::Env::RenameFile(const string &src, const string &target)=0` {#virtual_Status_tensorflow_Env_RenameFile}
#### `Status tensorflow::Env::RenameFile(const string &src, const string &target)` {#Status_tensorflow_Env_RenameFile}

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

Expand Down
58 changes: 5 additions & 53 deletions tensorflow/g3doc/api_docs/cc/ClassEnvWrapper.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,69 +24,21 @@ Returns the target to which this Env forwards all calls.



#### `Status tensorflow::EnvWrapper::NewRandomAccessFile(const string &f, RandomAccessFile **r) override` {#Status_tensorflow_EnvWrapper_NewRandomAccessFile}
#### `Status tensorflow::EnvWrapper::GetFileSystemForFile(const string &fname, FileSystem **result) override` {#Status_tensorflow_EnvWrapper_GetFileSystemForFile}

Creates a brand new random access read-only file with the specified name.
Returns the FileSystem object to handle operations on the file specified by &apos;fname&apos;. The FileSystem object is used as the implementation for the file system related (non-virtual) functions that follow. Returned FileSystem object is still owned by the Env object and will.

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` {#Status_tensorflow_EnvWrapper_NewWritableFile}
#### `Status tensorflow::EnvWrapper::GetRegisteredFileSystemSchemes(std::vector< string > *schemes) override` {#Status_tensorflow_EnvWrapper_GetRegisteredFileSystemSchemes}

Creates an object that writes to a new file with the specified name.
Returns the file system schemes registered for this Env .

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` {#Status_tensorflow_EnvWrapper_NewAppendableFile}
#### `void tensorflow::EnvWrapper::RegisterFileSystem(const string &scheme, FileSystemRegistry::Factory factory) override` {#void_tensorflow_EnvWrapper_RegisterFileSystem}

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` {#bool_tensorflow_EnvWrapper_FileExists}

Returns true iff the named file exists.



#### `Status tensorflow::EnvWrapper::GetChildren(const string &dir, std::vector< string > *r) override` {#Status_tensorflow_EnvWrapper_GetChildren}

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` {#Status_tensorflow_EnvWrapper_DeleteFile}

Deletes the named file.



#### `Status tensorflow::EnvWrapper::CreateDir(const string &d) override` {#Status_tensorflow_EnvWrapper_CreateDir}

Creates the specified directory.



#### `Status tensorflow::EnvWrapper::DeleteDir(const string &d) override` {#Status_tensorflow_EnvWrapper_DeleteDir}

Deletes the specified directory.



#### `Status tensorflow::EnvWrapper::GetFileSize(const string &f, uint64 *s) override` {#Status_tensorflow_EnvWrapper_GetFileSize}

Stores the size of `fname` in `*file_size`.



#### `Status tensorflow::EnvWrapper::RenameFile(const string &s, const string &t) override` {#Status_tensorflow_EnvWrapper_RenameFile}

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



Expand Down
8 changes: 7 additions & 1 deletion tensorflow/g3doc/api_docs/cc/ClassPartialTensorShape.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,14 @@ Returns `OK` iff `proto` is a valid tensor shape, and a descriptive error status



#### `Status tensorflow::PartialTensorShape::MakePartialShape(const T *dims, int n, PartialTensorShape *out)` {#Status_tensorflow_PartialTensorShape_MakePartialShape}
#### `static Status tensorflow::PartialTensorShape::MakePartialShape(const int32 *dims, int n, PartialTensorShape *out)` {#static_Status_tensorflow_PartialTensorShape_MakePartialShape}

Returns a ` PartialTensorShape ` whose dimensions are `dims[0]`, `dims[1]`, ..., `dims[n-1]`. Values of -1 are considered "unknown".



#### `static Status tensorflow::PartialTensorShape::MakePartialShape(const int64 *dims, int n, PartialTensorShape *out)` {#static_Status_tensorflow_PartialTensorShape_MakePartialShape}




4 changes: 2 additions & 2 deletions tensorflow/g3doc/api_docs/cc/ClassPartialTensorShapeUtils.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ Static helper routines for ` PartialTensorShape `. Includes a few common predica

###Member Details

#### `static string tensorflow::PartialTensorShapeUtils::PartialShapeListString(const gtl::ArraySlice< PartialTensorShape > &shapes)` {#static_string_tensorflow_PartialTensorShapeUtils_PartialShapeListString}
#### `string tensorflow::PartialTensorShapeUtils::PartialShapeListString(const gtl::ArraySlice< PartialTensorShape > &shapes)` {#string_tensorflow_PartialTensorShapeUtils_PartialShapeListString}





#### `static bool tensorflow::PartialTensorShapeUtils::AreCompatible(const gtl::ArraySlice< PartialTensorShape > &shapes0, const gtl::ArraySlice< PartialTensorShape > &shapes1)` {#static_bool_tensorflow_PartialTensorShapeUtils_AreCompatible}
#### `bool tensorflow::PartialTensorShapeUtils::AreCompatible(const gtl::ArraySlice< PartialTensorShape > &shapes0, const gtl::ArraySlice< PartialTensorShape > &shapes1)` {#bool_tensorflow_PartialTensorShapeUtils_AreCompatible}



Expand Down
2 changes: 1 addition & 1 deletion tensorflow/g3doc/api_docs/cc/ClassRandomAccessFile.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ A file abstraction for randomly reading the contents of a file.



#### `virtual Status tensorflow::RandomAccessFile::Read(uint64 offset, size_t n, StringPiece *result, char *scratch) const =0` {#virtual_Status_tensorflow_RandomAccessFile_Read}
#### `virtual Status tensorflow::RandomAccessFile::Read(uint64 offset, size_t n, StringPiece *result, char *scratch) const =0` {#virtual_Status_tensorflow_RandomAccessFile_Read}

Reads up to `n` bytes from the file starting at `offset`.

Expand Down
69 changes: 32 additions & 37 deletions tensorflow/g3doc/api_docs/cc/ClassSession.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,42 +6,25 @@ When a Session is created with a given target, a new Session object is bound to

Example:

```c++ tensorflow::GraphDef graph;
// ... Create or load graph into "graph".
{c++} tensorflow::GraphDef graph; // ... Create or load graph into "graph". // This example uses the default options which connects // to a local runtime. tensorflow::SessionOptions options; std::unique_ptr<tensorflow::Session> session(tensorflow::NewSession(options)); // Create the session with this graph. tensorflow::Status s = session->Create(graph); if (!s.ok()) { ... } // Run the graph and fetch the first output of the "output" // operation, and also run to but do not return anything // for the "update_state" operation. std::vector<tensorflow::Tensor> outputs; s = session->Run({}, {"output:0"}, {"update_state"}, &outputs); if (!s.ok()) { ... } // Map the output as a flattened float tensor, and do something // with it. auto output_tensor = outputs[0].flat<float>(); if (output_tensor(0) > 0.5) { ... } // Close the session to release the resources associated with // this session. session->Close();

// This example uses the default options which connects
// to a local runtime.
tensorflow::SessionOptions options;
std::unique_ptr<tensorflow::Session>
session(tensorflow::NewSession(options));
A Session allows concurrent calls to Run() , though a Session must be created / extended by a single thread.

// Create the session with this graph.
tensorflow::Status s = session->Create(graph);
if (!s.ok()) { ... }
Only one thread must call Close() , and Close() must only be called after all other calls to Run() have returned.

// Run the graph and fetch the first output of the "output"
// operation, and also run to but do not return anything
// for the "update_state" operation.
std::vector<tensorflow::Tensor> outputs;
s = session->Run({}, {"output:0"}, {"update_state"}, &outputs);
if (!s.ok()) { ... }
###Member Details

// Map the output as a flattened float tensor, and do something
// with it.
auto output_tensor = outputs[0].flat<float>();
if (output_tensor(0) > 0.5) { ... }
#### `tensorflow::Session::Session()` {#tensorflow_Session_Session}

// Close the session to release the resources associated with
// this session.
session->Close();

```

A Session allows concurrent calls to Run() , though a Session must be created / extended by a single thread.

Only one thread must call Close() , and Close() must only be called after all other calls to Run() have returned.

###Member Details
#### `virtual tensorflow::Session::~Session()` {#virtual_tensorflow_Session_Session}





#### `virtual Status tensorflow::Session::Create(const GraphDef &graph)=0` {#virtual_Status_tensorflow_Session_Create}

Expand All @@ -67,32 +50,44 @@ REQUIRES: The name of each Tensor of the input or output must match a "Tensor en

REQUIRES: outputs is not nullptr if `output_tensor_names` is non-empty.

#### `virtual Status tensorflow::Session::RunWithOpts(const RunOptions &run_options, const std::vector< std::pair< string, Tensor > > &inputs, const std::vector< string > &output_tensor_names, const std::vector< string > &target_node_names, std::vector< Tensor > *outputs, RunMetadata *run_metadata)` {#virtual_Status_tensorflow_Session_RunWithOpts}
#### `virtual Status tensorflow::Session::Create(const RunOptions &run_options, const GraphDef &graph)` {#virtual_Status_tensorflow_Session_Create}

Like `Run`, but allows users to pass in a `RunOptions` proto and to retrieve non-Tensor metadata output via a `RunMetadata` proto for this step. NOTE: This API is still experimental and may change.
Implementations which support `RunOptions`.

NOTE: This API is still experimental and may change.

#### `virtual Status tensorflow::Session::Extend(const RunOptions &run_options, const GraphDef &graph)` {#virtual_Status_tensorflow_Session_Extend}

#### `virtual Status tensorflow::Session::PRunSetup(const std::vector< string > &input_names, const std::vector< string > &output_names, const std::vector< string > &target_nodes, string *handle)` {#virtual_Status_tensorflow_Session_PRunSetup}

Sets up a graph for partial execution. All future feeds and fetches are specified by &apos;input_names&apos; and &apos;output_names&apos;. Returns &apos;handle&apos; that can be used to perform a sequence of partial feeds and fetches. NOTE: This API is still experimental and may change.



#### `virtual Status tensorflow::Session::PRun(const string &handle, const std::vector< std::pair< string, Tensor > > &inputs, const std::vector< string > &output_names, std::vector< Tensor > *outputs)` {#virtual_Status_tensorflow_Session_PRun}
#### `virtual Status tensorflow::Session::Close(const RunOptions &run_options)` {#virtual_Status_tensorflow_Session_Close}

Continues the pending execution specified by &apos;handle&apos; with the provided input tensors and fills `outputs` for the endpoints specified in `output_names`. NOTE: This API is still experimental and may change.



#### `virtual Status tensorflow::Session::Close()=0` {#virtual_Status_tensorflow_Session_Close}

Closes this session.
#### `virtual Status tensorflow::Session::Run(const RunOptions &run_options, const std::vector< std::pair< string, Tensor > > &inputs, const std::vector< string > &output_tensor_names, const std::vector< string > &target_node_names, std::vector< Tensor > *outputs, RunMetadata *run_metadata)` {#virtual_Status_tensorflow_Session_Run}

Closing a session releases the resources used by this session on the TensorFlow runtime (specified during session creation by the ` SessionOptions::target ` field).
Like `Run`, but allows users to pass in a `RunOptions` proto and to retrieve non-Tensor metadata output via a `RunMetadata` proto for this step. `run_metadata` may be nullptr, in which case any metadata output is discarded. NOTE: This API is still experimental and may change.

#### `virtual tensorflow::Session::~Session()` {#virtual_tensorflow_Session_Session}


#### `virtual Status tensorflow::Session::PRunSetup(const std::vector< string > &input_names, const std::vector< string > &output_names, const std::vector< string > &target_nodes, string *handle)` {#virtual_Status_tensorflow_Session_PRunSetup}

Sets up a graph for partial execution. All future feeds and fetches are specified by `input_names` and `output_names`. Returns `handle` that can be used to perform a sequence of partial feeds and fetches. NOTE: This API is still experimental and may change.



#### `virtual Status tensorflow::Session::PRun(const string &handle, const std::vector< std::pair< string, Tensor > > &inputs, const std::vector< string > &output_names, std::vector< Tensor > *outputs)` {#virtual_Status_tensorflow_Session_PRun}

Continues the pending execution specified by `handle` with the provided input tensors and fills `outputs` for the endpoints specified in `output_names`. NOTE: This API is still experimental and may change.



#### `virtual Status tensorflow::Session::Close()=0` {#virtual_Status_tensorflow_Session_Close}

Closes this session.

Closing a session releases the resources used by this session on the TensorFlow runtime (specified during session creation by the ` SessionOptions::target ` field).

0 comments on commit 8dc5ede

Please sign in to comment.