Skip to content

Commit ddf49b9

Browse files
committed
Update documentation for 0.11.0rc1
1 parent 8d9eb8e commit ddf49b9

File tree

7 files changed

+59
-69
lines changed

7 files changed

+59
-69
lines changed

tensorflow/g3doc/api_docs/cc/ClassEnv.md

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,24 @@ Stores in *result the names of the children of the specified directory. The name
9090

9191
Original contents of *results are dropped.
9292

93+
#### `virtual bool tensorflow::Env::MatchPath(const string &path, const string &pattern)=0` {#virtual_bool_tensorflow_Env_MatchPath}
94+
95+
Returns true if the path matches the given pattern. The wildcards allowed in pattern are described below (GetMatchingPaths).
96+
97+
98+
99+
#### `Status tensorflow::Env::GetMatchingPaths(const string &pattern, std::vector< string > *results)` {#Status_tensorflow_Env_GetMatchingPaths}
100+
101+
Given a pattern, stores in *results the set of paths that matches that pattern. *results is cleared.
102+
103+
pattern must match all of a name, not just a substring. pattern: { term } term: &apos;*&apos;: matches any sequence of non-&apos;/&apos; characters &apos;?&apos;: matches a single non-&apos;/&apos; character &apos;[&apos; [ &apos;^&apos; ] { match-list } &apos;]&apos;: matches any single character (not) on the list c: matches character c (c != &apos;*&apos;, &apos;?&apos;, &apos;\&apos;, &apos;[&apos;) &apos;\&apos; c: matches character c character-range: c: matches character c (c != &apos;\&apos;, &apos;-&apos;, &apos;]&apos;) &apos;\&apos; c: matches character c lo &apos;-&apos; hi: matches character c for lo <= c <= hi
104+
105+
Typical return codes
106+
107+
OK - no errors
108+
109+
UNIMPLEMENTED - Some underlying functions (like GetChildren) are not implemented The default implementation uses a combination of GetChildren, MatchPath and IsDirectory.
110+
93111
#### `Status tensorflow::Env::DeleteFile(const string &fname)` {#Status_tensorflow_Env_DeleteFile}
94112

95113
Deletes the named file.
@@ -110,11 +128,27 @@ PERMISSION_DENIED - dirname or some descendant is not writable
110128

111129
UNIMPLEMENTED - Some underlying functions (like Delete) are not implemented
112130

131+
#### `Status tensorflow::Env::RecursivelyCreateDir(const string &dirname)` {#Status_tensorflow_Env_RecursivelyCreateDir}
132+
133+
Creates the specified directory and all the necessary subdirectories. Typical return codes.
134+
135+
136+
137+
OK - successfully created the directory and sub directories, even if they were already created.
138+
139+
PERMISSION_DENIED - dirname or some subdirectory is not writable.
140+
113141
#### `Status tensorflow::Env::CreateDir(const string &dirname)` {#Status_tensorflow_Env_CreateDir}
114142

115-
Creates the specified directory.
143+
Creates the specified directory. Typical return codes.
144+
145+
146+
147+
OK - successfully created the directory.
116148

149+
ALREADY_EXISTS - directory already exists.
117150

151+
PERMISSION_DENIED - dirname is not writable.
118152

119153
#### `Status tensorflow::Env::DeleteDir(const string &dirname)` {#Status_tensorflow_Env_DeleteDir}
120154

tensorflow/g3doc/api_docs/cc/ClassEnvWrapper.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ Returns the file system schemes registered for this Env .
4242

4343

4444

45+
#### `bool tensorflow::EnvWrapper::MatchPath(const string &path, const string &pattern) override` {#bool_tensorflow_EnvWrapper_MatchPath}
46+
47+
Returns true if the path matches the given pattern. The wildcards allowed in pattern are described below (GetMatchingPaths).
48+
49+
50+
4551
#### `uint64 tensorflow::EnvWrapper::NowMicros() override` {#uint64_tensorflow_EnvWrapper_NowMicros}
4652

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

tensorflow/g3doc/api_docs/cc/ClassRandomAccessFile.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ A file abstraction for randomly reading the contents of a file.
1818

1919

2020

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

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

tensorflow/g3doc/api_docs/cc/ClassSession.md

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -6,36 +6,7 @@ When a Session is created with a given target, a new Session object is bound to
66

77
Example:
88

9-
```c++ tensorflow::GraphDef graph;
10-
// ... Create or load graph into "graph".
11-
12-
// This example uses the default options which connects
13-
// to a local runtime.
14-
tensorflow::SessionOptions options;
15-
std::unique_ptr<tensorflow::Session>
16-
session(tensorflow::NewSession(options));
17-
18-
// Create the session with this graph.
19-
tensorflow::Status s = session->Create(graph);
20-
if (!s.ok()) { ... }
21-
22-
// Run the graph and fetch the first output of the "output"
23-
// operation, and also run to but do not return anything
24-
// for the "update_state" operation.
25-
std::vector<tensorflow::Tensor> outputs;
26-
s = session->Run({}, {"output:0"}, {"update_state"}, &outputs);
27-
if (!s.ok()) { ... }
28-
29-
// Map the output as a flattened float tensor, and do something
30-
// with it.
31-
auto output_tensor = outputs[0].flat<float>();
32-
if (output_tensor(0) > 0.5) { ... }
33-
34-
// Close the session to release the resources associated with
35-
// this session.
36-
session->Close();
37-
38-
```
9+
{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();
3910

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

tensorflow/g3doc/api_docs/cc/ClassTensor.md

Lines changed: 4 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ Creates a 1-dimensional, 0-element float tensor.
1212

1313
The returned Tensor is not a scalar (shape {}), but is instead an empty one-dimensional Tensor (shape {0}, NumElements() == 0). Since it has no elements, it does not need to be assigned a value and is initialized by default ( IsInitialized() is true). If this is undesirable, consider creating a one-element scalar which does require initialization:
1414

15-
```c++ Tensor(DT_FLOAT, TensorShape({}))
16-
17-
```
15+
{c++} Tensor(DT_FLOAT, TensorShape({}))
1816

1917
#### `tensorflow::Tensor::Tensor(DataType type, const TensorShape &shape)` {#tensorflow_Tensor_Tensor}
2018

@@ -100,12 +98,6 @@ Convenience accessor for the tensor shape.
10098

10199

102100

103-
#### `size_t tensorflow::Tensor::BufferHash() const` {#size_t_tensorflow_Tensor_BufferHash}
104-
105-
106-
107-
108-
109101
#### `bool tensorflow::Tensor::IsInitialized() const` {#bool_tensorflow_Tensor_IsInitialized}
110102

111103
If necessary, has this Tensor been initialized?
@@ -184,15 +176,7 @@ Use these methods when you know the data type and the number of dimensions of th
184176

185177
Example:
186178

187-
```c++ typedef float T;
188-
Tensor my_mat(...built with Shape{rows: 3, cols: 5}...);
189-
auto mat = my_mat.matrix<T>(); // 2D Eigen::Tensor, 3 x 5.
190-
auto mat = my_mat.tensor<T, 2>(); // 2D Eigen::Tensor, 3 x 5.
191-
auto vec = my_mat.vec<T>(); // CHECK fails as my_mat is 2D.
192-
auto vec = my_mat.tensor<T, 3>(); // CHECK fails as my_mat is 2D.
193-
auto mat = my_mat.matrix<int32>();// CHECK fails as type mismatch.
194-
195-
```
179+
{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.
196180

197181
#### `TTypes<T>::Matrix tensorflow::Tensor::matrix()` {#TTypes_T_Matrix_tensorflow_Tensor_matrix}
198182

@@ -220,22 +204,7 @@ These methods allow you to access the data with the dimensions and sizes of your
220204

221205
Example:
222206

223-
```c++ typedef float T;
224-
Tensor my_ten(...built with Shape{planes: 4, rows: 3, cols: 5}...);
225-
// 1D Eigen::Tensor, size 60:
226-
auto flat = my_ten.flat<T>();
227-
// 2D Eigen::Tensor 12 x 5:
228-
auto inner = my_ten.flat_inner_dims<T>();
229-
// 2D Eigen::Tensor 4 x 15:
230-
auto outer = my_ten.shaped<T, 2>({4, 15});
231-
// CHECK fails, bad num elements:
232-
auto outer = my_ten.shaped<T, 2>({4, 8});
233-
// 3D Eigen::Tensor 6 x 5 x 2:
234-
auto weird = my_ten.shaped<T, 3>({6, 5, 2});
235-
// CHECK fails, type mismatch:
236-
auto bad = my_ten.flat<int32>();
237-
238-
```
207+
{c++} typedef float T; Tensor my_ten(...built with Shape{planes: 4, rows: 3, cols: 5}...); // 1D Eigen::Tensor, size 60: auto flat = my_ten.flat<T>(); // 2D Eigen::Tensor 12 x 5: auto inner = my_ten.flat_inner_dims<T>(); // 2D Eigen::Tensor 4 x 15: auto outer = my_ten.shaped<T, 2>({4, 15}); // CHECK fails, bad num elements: auto outer = my_ten.shaped<T, 2>({4, 8}); // 3D Eigen::Tensor 6 x 5 x 2: auto weird = my_ten.shaped<T, 3>({6, 5, 2}); // CHECK fails, type mismatch: auto bad = my_ten.flat<int32>();
239208

240209
#### `TTypes<T>::UnalignedFlat tensorflow::Tensor::unaligned_flat()` {#TTypes_T_UnalignedFlat_tensorflow_Tensor_unaligned_flat}
241210

@@ -379,7 +348,7 @@ NOTE: The underlying tensor buffer is refcounted, so the lifetime of the content
379348

380349
REQUIRES: `DataTypeCanUseMemcpy(dtype())`.
381350

382-
#### `void tensorflow::Tensor::UnsafeCopyFromInternal(const Tensor &, const TensorShape &)` {#void_tensorflow_Tensor_UnsafeCopyFromInternal}
351+
#### `void tensorflow::Tensor::UnsafeCopyFromInternal(const Tensor &, DataType dtype, const TensorShape &)` {#void_tensorflow_Tensor_UnsafeCopyFromInternal}
383352

384353

385354

tensorflow/g3doc/api_docs/python/functions_and_classes/shard5/tf.train.Saver.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ protocol buffer file in the call to `save()`.
7272

7373
- - -
7474

75-
#### `tf.train.Saver.__init__(var_list=None, reshape=False, sharded=False, max_to_keep=5, keep_checkpoint_every_n_hours=10000.0, name=None, restore_sequentially=False, saver_def=None, builder=None, defer_build=False, allow_empty=False)` {#Saver.__init__}
75+
#### `tf.train.Saver.__init__(var_list=None, reshape=False, sharded=False, max_to_keep=5, keep_checkpoint_every_n_hours=10000.0, name=None, restore_sequentially=False, saver_def=None, builder=None, defer_build=False, allow_empty=False, write_version=1)` {#Saver.__init__}
7676

7777
Creates a `Saver`.
7878

@@ -140,6 +140,11 @@ checkpoints per device.
140140
* <b>`allow_empty`</b>: If `False` (default) raise an error if there are no
141141
variables in the graph. Otherwise, construct the saver anyway and make
142142
it a no-op.
143+
* <b>`write_version`</b>: controls what format to use when saving checkpoints. It
144+
also affects certain filepath matching logic. Defaults to V1
145+
currently, and will be switched to the more memory-efficient V2 format
146+
in the future. If set to V2, the Saver is still able to restore from
147+
old V1 checkpoints.
143148

144149
##### Raises:
145150

tensorflow/g3doc/api_docs/python/state_ops.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1522,7 +1522,7 @@ protocol buffer file in the call to `save()`.
15221522

15231523
- - -
15241524

1525-
#### `tf.train.Saver.__init__(var_list=None, reshape=False, sharded=False, max_to_keep=5, keep_checkpoint_every_n_hours=10000.0, name=None, restore_sequentially=False, saver_def=None, builder=None, defer_build=False, allow_empty=False)` {#Saver.__init__}
1525+
#### `tf.train.Saver.__init__(var_list=None, reshape=False, sharded=False, max_to_keep=5, keep_checkpoint_every_n_hours=10000.0, name=None, restore_sequentially=False, saver_def=None, builder=None, defer_build=False, allow_empty=False, write_version=1)` {#Saver.__init__}
15261526

15271527
Creates a `Saver`.
15281528

@@ -1590,6 +1590,11 @@ checkpoints per device.
15901590
* <b>`allow_empty`</b>: If `False` (default) raise an error if there are no
15911591
variables in the graph. Otherwise, construct the saver anyway and make
15921592
it a no-op.
1593+
* <b>`write_version`</b>: controls what format to use when saving checkpoints. It
1594+
also affects certain filepath matching logic. Defaults to V1
1595+
currently, and will be switched to the more memory-efficient V2 format
1596+
in the future. If set to V2, the Saver is still able to restore from
1597+
old V1 checkpoints.
15931598

15941599
##### Raises:
15951600

0 commit comments

Comments
 (0)