Skip to content

Commit b5943bd

Browse files
authored
Small header changes and a Doxygen tweak to shape the C++ API a bit better. (tensorflow#5304)
Change: 135747447 (cherry picked from commit 120c3f1)
1 parent 83aedd7 commit b5943bd

File tree

5 files changed

+29
-1
lines changed

5 files changed

+29
-1
lines changed

tensorflow/core/framework/tensor.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,8 @@ class Tensor {
466466

467467
// Implementation details
468468

469+
// START_SKIP_DOXYGEN
470+
469471
// Interface to access the raw ref-counted data buffer.
470472
class TensorBuffer : public core::RefCounted {
471473
public:
@@ -659,6 +661,8 @@ inline Tensor& Tensor::operator=(Tensor&& other) {
659661
return *this;
660662
}
661663

664+
// END_SKIP_DOXYGEN
665+
662666
} // namespace tensorflow
663667

664668
#endif // TENSORFLOW_CORE_FRAMEWORK_TENSOR_H_

tensorflow/core/framework/tensor_shape.h

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,19 @@ limitations under the License.
3131

3232
namespace tensorflow {
3333

34+
// START_SKIP_DOXYGEN
3435
class TensorShapeIter; // Declared below
35-
36+
// END_SKIP_DOXYGEN
37+
38+
/// Represents the shape of a Tensor.
39+
///
40+
/// A tensor's shape is denoted by its number of dimensions and a size for each
41+
/// dimension. For example, a Tensor represented by a 3 x 4 matrix would have
42+
/// a shape of 2-D, [3,4].
43+
///
44+
/// If you know the exact shape of your Tensor when you create the TensorShape
45+
/// object, you can specify it then, or you can create a TensorShape with
46+
/// zero dimensions and one element, and call AddDim() to add dimensions later.
3647
class TensorShape {
3748
public:
3849
/// \brief Construct a `TensorShape` from the provided sizes.
@@ -220,11 +231,13 @@ class TensorShape {
220231
int64 num_elements_;
221232
};
222233

234+
/// Represents the value of one dimension in a TensorShape.
223235
struct TensorShapeDim {
224236
explicit TensorShapeDim(int64 s) : size(s) {}
225237
int64 size;
226238
};
227239

240+
// START_SKIP_DOXYGEN
228241
class TensorShapeIter {
229242
public:
230243
TensorShapeIter(const TensorShape* shape, int d) : shape_(shape), d_(d) {}
@@ -243,6 +256,7 @@ class TensorShapeIter {
243256
const TensorShape* shape_;
244257
int d_;
245258
};
259+
// END_SKIP_DOXYGEN
246260

247261
/// \brief Static helper routines for `TensorShape`. Includes a few common
248262
/// predicates on a tensor shape.

tensorflow/core/lib/core/status.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ limitations under the License.
2525

2626
namespace tensorflow {
2727

28+
/// Denotes success or failure of a call in Tensorflow.
2829
class Status {
2930
public:
3031
/// Create a success status.

tensorflow/core/platform/env.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,7 @@ class EnvWrapper : public Env {
343343
Env* target_;
344344
};
345345

346+
/// Represents a thread used to run a Tensorflow function.
346347
class Thread {
347348
public:
348349
Thread() {}
@@ -382,6 +383,8 @@ Status WriteBinaryProto(Env* env, const string& fname,
382383
Status ReadBinaryProto(Env* env, const string& fname,
383384
::tensorflow::protobuf::MessageLite* proto);
384385

386+
// START_SKIP_DOXYGEN
387+
385388
namespace register_file_system {
386389

387390
template <typename Factory>
@@ -394,6 +397,8 @@ struct Register {
394397

395398
} // namespace register_file_system
396399

400+
// END_SKIP_DOXYGEN
401+
397402
} // namespace tensorflow
398403

399404
// Register a FileSystem implementation for a scheme. Files with names that have

tensorflow/core/platform/file_system.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ class FileSystem {
9898
virtual Status IsDirectory(const string& fname);
9999
};
100100

101+
// START_SKIP_DOXYGEN
102+
101103
#ifndef SWIG
102104
// Degenerate file system that provides no implementations.
103105
class NullFileSystem : public FileSystem {
@@ -160,6 +162,8 @@ class NullFileSystem : public FileSystem {
160162
};
161163
#endif
162164

165+
// END_SKIP_DOXYGEN
166+
163167
/// A file abstraction for randomly reading the contents of a file.
164168
class RandomAccessFile {
165169
public:

0 commit comments

Comments
 (0)