Skip to content

Commit 120c3f1

Browse files
Small header changes and a Doxygen tweak to shape the C++ API a bit better.
Change: 135747447
1 parent 949d4d4 commit 120c3f1

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
@@ -323,6 +323,7 @@ class EnvWrapper : public Env {
323323
Env* target_;
324324
};
325325

326+
/// Represents a thread used to run a Tensorflow function.
326327
class Thread {
327328
public:
328329
Thread() {}
@@ -367,6 +368,8 @@ Status ReadBinaryProto(Env* env, const string& fname,
367368
Status ReadTextProto(Env* env, const string& fname,
368369
::tensorflow::protobuf::Message* proto);
369370

371+
// START_SKIP_DOXYGEN
372+
370373
namespace register_file_system {
371374

372375
template <typename Factory>
@@ -379,6 +382,8 @@ struct Register {
379382

380383
} // namespace register_file_system
381384

385+
// END_SKIP_DOXYGEN
386+
382387
} // namespace tensorflow
383388

384389
// 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
@@ -146,6 +146,8 @@ class FileSystem {
146146
virtual Status IsDirectory(const string& fname);
147147
};
148148

149+
// START_SKIP_DOXYGEN
150+
149151
#ifndef SWIG
150152
// Degenerate file system that provides no implementations.
151153
class NullFileSystem : public FileSystem {
@@ -208,6 +210,8 @@ class NullFileSystem : public FileSystem {
208210
};
209211
#endif
210212

213+
// END_SKIP_DOXYGEN
214+
211215
/// A file abstraction for randomly reading the contents of a file.
212216
class RandomAccessFile {
213217
public:

0 commit comments

Comments
 (0)