Skip to content

Commit a5ac11d

Browse files
author
Vijay Vasudevan
committed
TensorFlow: Upstream latest changes to git.
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
1 parent 7630546 commit a5ac11d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+2003
-1752
lines changed

tensorflow/core/public/session.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@ namespace tensorflow {
2525
///
2626
/// Example:
2727
///
28+
/// ```c++
29+
///
2830
/// tensorflow::GraphDef graph;
29-
/// // ... Create or load graph into 'graph'.
31+
/// // ... Create or load graph into "graph".
3032
///
3133
/// // This example uses the default options which connects
3234
/// // to a local runtime.
@@ -54,6 +56,8 @@ namespace tensorflow {
5456
/// // this session.
5557
/// session->Close()
5658
///
59+
/// ```
60+
///
5761
/// A Session allows concurrent calls to Run(), though a Session must
5862
/// be created / extended by a single thread.
5963
///

tensorflow/core/public/tensor.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,13 +132,18 @@ class Tensor {
132132
/// fails if either type or sizes mismatch.
133133
///
134134
/// Example:
135+
///
136+
/// ```c++
137+
///
135138
/// typedef float T;
136139
/// Tensor my_mat(...built with Shape{rows: 3, cols: 5}...);
137140
/// auto mat = my_mat.matrix<T>(); // 2D Eigen::Tensor, 3 x 5.
138141
/// auto mat = my_mat.tensor<T, 2>(); // 2D Eigen::Tensor, 3 x 5.
139142
/// auto vec = my_mat.vec<T>(); // CHECK fails as my_mat is 2D.
140143
/// auto vec = my_mat.tensor<T, 3>(); // CHECK fails as my_mat is 2D.
141144
/// auto mat = my_mat.matrix<int32>();// CHECK fails as type mismatch.
145+
///
146+
/// ```
142147
template <typename T>
143148
typename TTypes<T>::Vec vec() {
144149
return tensor<T, 1>();
@@ -162,6 +167,9 @@ class Tensor {
162167
/// Eigen::Tensor with the same number of elements as the Tensor.
163168
///
164169
/// Example:
170+
///
171+
/// ```c++
172+
///
165173
/// typedef float T;
166174
/// Tensor my_ten(...built with Shape{planes: 4, rows: 3, cols: 5}...);
167175
/// // 1D Eigen::Tensor, size 60:
@@ -176,6 +184,8 @@ class Tensor {
176184
/// auto weird = my_ten.shaped<T, 3>({6, 5, 2});
177185
/// // CHECK fails, type mismatch:
178186
/// auto bad = my_ten.flat<int32>();
187+
///
188+
/// ```
179189
template <typename T>
180190
typename TTypes<T>::Flat flat() {
181191
return shaped<T, 1>({NumElements()});

tensorflow/g3doc/api_docs/cc/ClassEnv.md

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#Class tensorflow::Env <a class="md-anchor" id="AUTOGENERATED-class-tensorflow--env"></a>
1+
# Class `tensorflow::Env` <a class="md-anchor" id="AUTOGENERATED-class--tensorflow--env-"></a>
22

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

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

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

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

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

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

4646

4747

4848

4949

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

5252

5353

5454

5555

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

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

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

6262
The returned file may be concurrently accessed by multiple threads.
6363

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

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

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

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

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

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

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

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

80-
#### virtual bool tensorflow::Env::FileExists(const string &amp;fname)=0 <a class="md-anchor" id="virtual_bool_tensorflow_Env_FileExists"></a>
80+
#### `virtual bool tensorflow::Env::FileExists(const string &fname)=0` <a class="md-anchor" id="virtual_bool_tensorflow_Env_FileExists"></a>
8181

8282
Returns true iff the named file exists.
8383

8484

8585

86-
#### 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>
86+
#### `virtual Status tensorflow::Env::GetChildren(const string &dir, std::vector< string > *result)=0` <a class="md-anchor" id="virtual_Status_tensorflow_Env_GetChildren"></a>
8787

88-
Stores in *result the names of the children of the specified directory. The names are relative to &quot;dir&quot;.
88+
Stores in *result the names of the children of the specified directory. The names are relative to "dir".
8989

9090
Original contents of *results are dropped.
9191

92-
#### virtual Status tensorflow::Env::DeleteFile(const string &amp;fname)=0 <a class="md-anchor" id="virtual_Status_tensorflow_Env_DeleteFile"></a>
92+
#### `virtual Status tensorflow::Env::DeleteFile(const string &fname)=0` <a class="md-anchor" id="virtual_Status_tensorflow_Env_DeleteFile"></a>
9393

9494
Deletes the named file.
9595

9696

9797

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

100100
Creates the specified directory.
101101

102102

103103

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

106106
Deletes the specified directory.
107107

108108

109109

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

112112
Stores the size of fname in *file_size.
113113

114114

115115

116-
#### 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>
116+
#### `virtual Status tensorflow::Env::RenameFile(const string &src, const string &target)=0` <a class="md-anchor" id="virtual_Status_tensorflow_Env_RenameFile"></a>
117117

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

120120

121121

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

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

126126

127127

128-
#### virtual void tensorflow::Env::SleepForMicroseconds(int micros)=0 <a class="md-anchor" id="virtual_void_tensorflow_Env_SleepForMicroseconds"></a>
128+
#### `virtual void tensorflow::Env::SleepForMicroseconds(int micros)=0` <a class="md-anchor" id="virtual_void_tensorflow_Env_SleepForMicroseconds"></a>
129129

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

132132

133133

134-
#### 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>
134+
#### `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>
135135

136-
Returns a new thread that is running fn() and is identified (for debugging/performance-analysis) by &quot;name&quot;.
136+
Returns a new thread that is running fn() and is identified (for debugging/performance-analysis) by "name".
137137

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

140-
#### static Env* tensorflow::Env::Default() <a class="md-anchor" id="static_Env_tensorflow_Env_Default"></a>
140+
#### `static Env* tensorflow::Env::Default()` <a class="md-anchor" id="static_Env_tensorflow_Env_Default"></a>
141141

142142
Returns a default environment suitable for the current operating system.
143143

0 commit comments

Comments
 (0)