Skip to content

Commit

Permalink
TensorFlow: Upstream latest changes to git.
Browse files Browse the repository at this point in the history
Changes:
- Documentation changes: adding some examples
  for adding_an_op, fixes to some of the markdown,
  updates to docstrings, etc.

- Remove Dockerfile for now -- still undergoing
  changes.

Base CL: 107341050
  • Loading branch information
Vijay Vasudevan committed Nov 8, 2015
1 parent 7630546 commit a5ac11d
Show file tree
Hide file tree
Showing 64 changed files with 2,003 additions and 1,752 deletions.
6 changes: 5 additions & 1 deletion tensorflow/core/public/session.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ namespace tensorflow {
///
/// Example:
///
/// ```c++
///
/// tensorflow::GraphDef graph;
/// // ... Create or load graph into 'graph'.
/// // ... Create or load graph into "graph".
///
/// // This example uses the default options which connects
/// // to a local runtime.
Expand Down Expand Up @@ -54,6 +56,8 @@ namespace tensorflow {
/// // this session.
/// session->Close()
///
/// ```
///
/// A Session allows concurrent calls to Run(), though a Session must
/// be created / extended by a single thread.
///
Expand Down
10 changes: 10 additions & 0 deletions tensorflow/core/public/tensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,18 @@ class Tensor {
/// fails if either type or sizes mismatch.
///
/// Example:
///
/// ```c++
///
/// typedef float T;
/// Tensor my_mat(...built with Shape{rows: 3, cols: 5}...);
/// auto mat = my_mat.matrix<T>(); // 2D Eigen::Tensor, 3 x 5.
/// auto mat = my_mat.tensor<T, 2>(); // 2D Eigen::Tensor, 3 x 5.
/// auto vec = my_mat.vec<T>(); // CHECK fails as my_mat is 2D.
/// auto vec = my_mat.tensor<T, 3>(); // CHECK fails as my_mat is 2D.
/// auto mat = my_mat.matrix<int32>();// CHECK fails as type mismatch.
///
/// ```
template <typename T>
typename TTypes<T>::Vec vec() {
return tensor<T, 1>();
Expand All @@ -162,6 +167,9 @@ class Tensor {
/// Eigen::Tensor with the same number of elements as the Tensor.
///
/// Example:
///
/// ```c++
///
/// typedef float T;
/// Tensor my_ten(...built with Shape{planes: 4, rows: 3, cols: 5}...);
/// // 1D Eigen::Tensor, size 60:
Expand All @@ -176,6 +184,8 @@ class Tensor {
/// auto weird = my_ten.shaped<T, 3>({6, 5, 2});
/// // CHECK fails, type mismatch:
/// auto bad = my_ten.flat<int32>();
///
/// ```
template <typename T>
typename TTypes<T>::Flat flat() {
return shaped<T, 1>({NumElements()});
Expand Down
74 changes: 37 additions & 37 deletions tensorflow/g3doc/api_docs/cc/ClassEnv.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Class tensorflow::Env <a class="md-anchor" id="AUTOGENERATED-class-tensorflow--env"></a>
# Class `tensorflow::Env` <a class="md-anchor" id="AUTOGENERATED-class--tensorflow--env-"></a>

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

Expand All @@ -8,136 +8,136 @@ All Env implementations are safe for concurrent access from multiple threads wit

##Member Summary <a class="md-anchor" id="AUTOGENERATED-member-summary"></a>

* [tensorflow::Env::Env](#tensorflow_Env_Env)
* [virtual tensorflow::Env::~Env](#virtual_tensorflow_Env_Env)
* [virtual Status tensorflow::Env::NewRandomAccessFile](#virtual_Status_tensorflow_Env_NewRandomAccessFile)
* [`tensorflow::Env::Env()`](#tensorflow_Env_Env)
* [`virtual tensorflow::Env::~Env()`](#virtual_tensorflow_Env_Env)
* [`virtual Status tensorflow::Env::NewRandomAccessFile(const string &fname, RandomAccessFile **result)=0`](#virtual_Status_tensorflow_Env_NewRandomAccessFile)
* Creates a brand new random access read-only file with the specified name.
* [virtual Status tensorflow::Env::NewWritableFile](#virtual_Status_tensorflow_Env_NewWritableFile)
* [`virtual Status tensorflow::Env::NewWritableFile(const string &fname, WritableFile **result)=0`](#virtual_Status_tensorflow_Env_NewWritableFile)
* Creates an object that writes to a new file with the specified name.
* [virtual Status tensorflow::Env::NewAppendableFile](#virtual_Status_tensorflow_Env_NewAppendableFile)
* [`virtual Status tensorflow::Env::NewAppendableFile(const string &fname, WritableFile **result)=0`](#virtual_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).
* [virtual bool tensorflow::Env::FileExists](#virtual_bool_tensorflow_Env_FileExists)
* [`virtual bool tensorflow::Env::FileExists(const string &fname)=0`](#virtual_bool_tensorflow_Env_FileExists)
* Returns true iff the named file exists.
* [virtual Status tensorflow::Env::GetChildren](#virtual_Status_tensorflow_Env_GetChildren)
* Stores in *result the names of the children of the specified directory. The names are relative to &quot;dir&quot;.
* [virtual Status tensorflow::Env::DeleteFile](#virtual_Status_tensorflow_Env_DeleteFile)
* [`virtual Status tensorflow::Env::GetChildren(const string &dir, std::vector< string > *result)=0`](#virtual_Status_tensorflow_Env_GetChildren)
* Stores in *result the names of the children of the specified directory. The names are relative to "dir".
* [`virtual Status tensorflow::Env::DeleteFile(const string &fname)=0`](#virtual_Status_tensorflow_Env_DeleteFile)
* Deletes the named file.
* [virtual Status tensorflow::Env::CreateDir](#virtual_Status_tensorflow_Env_CreateDir)
* [`virtual Status tensorflow::Env::CreateDir(const string &dirname)=0`](#virtual_Status_tensorflow_Env_CreateDir)
* Creates the specified directory.
* [virtual Status tensorflow::Env::DeleteDir](#virtual_Status_tensorflow_Env_DeleteDir)
* [`virtual Status tensorflow::Env::DeleteDir(const string &dirname)=0`](#virtual_Status_tensorflow_Env_DeleteDir)
* Deletes the specified directory.
* [virtual Status tensorflow::Env::GetFileSize](#virtual_Status_tensorflow_Env_GetFileSize)
* [`virtual Status tensorflow::Env::GetFileSize(const string &fname, uint64 *file_size)=0`](#virtual_Status_tensorflow_Env_GetFileSize)
* Stores the size of fname in *file_size.
* [virtual Status tensorflow::Env::RenameFile](#virtual_Status_tensorflow_Env_RenameFile)
* [`virtual Status tensorflow::Env::RenameFile(const string &src, const string &target)=0`](#virtual_Status_tensorflow_Env_RenameFile)
* Renames file src to target. If target already exists, it will be replaced.
* [virtual uint64 tensorflow::Env::NowMicros](#virtual_uint64_tensorflow_Env_NowMicros)
* [`virtual uint64 tensorflow::Env::NowMicros()=0`](#virtual_uint64_tensorflow_Env_NowMicros)
* Returns the number of micro-seconds since some fixed point in time. Only useful for computing deltas of time.
* [virtual void tensorflow::Env::SleepForMicroseconds](#virtual_void_tensorflow_Env_SleepForMicroseconds)
* [`virtual void tensorflow::Env::SleepForMicroseconds(int micros)=0`](#virtual_void_tensorflow_Env_SleepForMicroseconds)
* Sleeps/delays the thread for the prescribed number of micro-seconds.
* [virtual Thread* tensorflow::Env::StartThread](#virtual_Thread_tensorflow_Env_StartThread)
* Returns a new thread that is running fn() and is identified (for debugging/performance-analysis) by &quot;name&quot;.
* [static Env* tensorflow::Env::Default](#static_Env_tensorflow_Env_Default)
* [`virtual Thread* tensorflow::Env::StartThread(const ThreadOptions &thread_options, const string &name, std::function< void()> fn) TF_MUST_USE_RESULT=0`](#virtual_Thread_tensorflow_Env_StartThread)
* Returns a new thread that is running fn() and is identified (for debugging/performance-analysis) by "name".
* [`static Env* tensorflow::Env::Default()`](#static_Env_tensorflow_Env_Default)
* Returns a default environment suitable for the current operating system.

##Member Details <a class="md-anchor" id="AUTOGENERATED-member-details"></a>

#### tensorflow::Env::Env() <a class="md-anchor" id="tensorflow_Env_Env"></a>
#### `tensorflow::Env::Env()` <a class="md-anchor" id="tensorflow_Env_Env"></a>





#### virtual tensorflow::Env::~Env() <a class="md-anchor" id="virtual_tensorflow_Env_Env"></a>
#### `virtual tensorflow::Env::~Env()` <a class="md-anchor" id="virtual_tensorflow_Env_Env"></a>





#### virtual Status tensorflow::Env::NewRandomAccessFile(const string &amp;fname, RandomAccessFile **result)=0 <a class="md-anchor" id="virtual_Status_tensorflow_Env_NewRandomAccessFile"></a>
#### `virtual Status tensorflow::Env::NewRandomAccessFile(const string &fname, RandomAccessFile **result)=0` <a class="md-anchor" id="virtual_Status_tensorflow_Env_NewRandomAccessFile"></a>

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 &amp;fname, WritableFile **result)=0 <a class="md-anchor" id="virtual_Status_tensorflow_Env_NewWritableFile"></a>
#### `virtual Status tensorflow::Env::NewWritableFile(const string &fname, WritableFile **result)=0` <a class="md-anchor" id="virtual_Status_tensorflow_Env_NewWritableFile"></a>

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 &amp;fname, WritableFile **result)=0 <a class="md-anchor" id="virtual_Status_tensorflow_Env_NewAppendableFile"></a>
#### `virtual Status tensorflow::Env::NewAppendableFile(const string &fname, WritableFile **result)=0` <a class="md-anchor" id="virtual_Status_tensorflow_Env_NewAppendableFile"></a>

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 &amp;fname)=0 <a class="md-anchor" id="virtual_bool_tensorflow_Env_FileExists"></a>
#### `virtual bool tensorflow::Env::FileExists(const string &fname)=0` <a class="md-anchor" id="virtual_bool_tensorflow_Env_FileExists"></a>

Returns true iff the named file exists.



#### virtual Status tensorflow::Env::GetChildren(const string &amp;dir, std::vector&lt; string &gt; *result)=0 <a class="md-anchor" id="virtual_Status_tensorflow_Env_GetChildren"></a>
#### `virtual Status tensorflow::Env::GetChildren(const string &dir, std::vector< string > *result)=0` <a class="md-anchor" id="virtual_Status_tensorflow_Env_GetChildren"></a>

Stores in *result the names of the children of the specified directory. The names are relative to &quot;dir&quot;.
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 &amp;fname)=0 <a class="md-anchor" id="virtual_Status_tensorflow_Env_DeleteFile"></a>
#### `virtual Status tensorflow::Env::DeleteFile(const string &fname)=0` <a class="md-anchor" id="virtual_Status_tensorflow_Env_DeleteFile"></a>

Deletes the named file.



#### virtual Status tensorflow::Env::CreateDir(const string &amp;dirname)=0 <a class="md-anchor" id="virtual_Status_tensorflow_Env_CreateDir"></a>
#### `virtual Status tensorflow::Env::CreateDir(const string &dirname)=0` <a class="md-anchor" id="virtual_Status_tensorflow_Env_CreateDir"></a>

Creates the specified directory.



#### virtual Status tensorflow::Env::DeleteDir(const string &amp;dirname)=0 <a class="md-anchor" id="virtual_Status_tensorflow_Env_DeleteDir"></a>
#### `virtual Status tensorflow::Env::DeleteDir(const string &dirname)=0` <a class="md-anchor" id="virtual_Status_tensorflow_Env_DeleteDir"></a>

Deletes the specified directory.



#### virtual Status tensorflow::Env::GetFileSize(const string &amp;fname, uint64 *file_size)=0 <a class="md-anchor" id="virtual_Status_tensorflow_Env_GetFileSize"></a>
#### `virtual Status tensorflow::Env::GetFileSize(const string &fname, uint64 *file_size)=0` <a class="md-anchor" id="virtual_Status_tensorflow_Env_GetFileSize"></a>

Stores the size of fname in *file_size.



#### virtual Status tensorflow::Env::RenameFile(const string &amp;src, const string &amp;target)=0 <a class="md-anchor" id="virtual_Status_tensorflow_Env_RenameFile"></a>
#### `virtual Status tensorflow::Env::RenameFile(const string &src, const string &target)=0` <a class="md-anchor" id="virtual_Status_tensorflow_Env_RenameFile"></a>

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



#### virtual uint64 tensorflow::Env::NowMicros()=0 <a class="md-anchor" id="virtual_uint64_tensorflow_Env_NowMicros"></a>
#### `virtual uint64 tensorflow::Env::NowMicros()=0` <a class="md-anchor" id="virtual_uint64_tensorflow_Env_NowMicros"></a>

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 <a class="md-anchor" id="virtual_void_tensorflow_Env_SleepForMicroseconds"></a>
#### `virtual void tensorflow::Env::SleepForMicroseconds(int micros)=0` <a class="md-anchor" id="virtual_void_tensorflow_Env_SleepForMicroseconds"></a>

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



#### virtual Thread* tensorflow::Env::StartThread(const ThreadOptions &amp;thread_options, const string &amp;name, std::function&lt; void()&gt; fn) TF_MUST_USE_RESULT=0 <a class="md-anchor" id="virtual_Thread_tensorflow_Env_StartThread"></a>
#### `virtual Thread* tensorflow::Env::StartThread(const ThreadOptions &thread_options, const string &name, std::function< void()> fn) TF_MUST_USE_RESULT=0` <a class="md-anchor" id="virtual_Thread_tensorflow_Env_StartThread"></a>

Returns a new thread that is running fn() and is identified (for debugging/performance-analysis) by &quot;name&quot;.
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() <a class="md-anchor" id="static_Env_tensorflow_Env_Default"></a>
#### `static Env* tensorflow::Env::Default()` <a class="md-anchor" id="static_Env_tensorflow_Env_Default"></a>

Returns a default environment suitable for the current operating system.

Expand Down
Loading

0 comments on commit a5ac11d

Please sign in to comment.