[doc] Extend code documentation
authorDonghyeon Jeong <dhyeon.jeong@samsung.com>
Wed, 31 Jul 2024 03:15:33 +0000 (12:15 +0900)
committerJijoong Moon <jijoong.moon@samsung.com>
Thu, 1 Aug 2024 01:51:08 +0000 (10:51 +0900)
This PR adds summary content to help users quickly understand the role and scope of the Tensor API.

**Self-evaluation:**
1. Build test: [ ]Passed [ ]Failed [X]Skipped
2. Run test:   [ ]Passed [ ]Failed [X]Skipped

Signed-off-by: Donghyeon Jeong <dhyeon.jeong@samsung.com>
nntrainer/tensor/tensor.h
nntrainer/tensor/tensor_base.h

index b5df3ab9bd984fdf95c649b96944259b0fbb64a9..dd6e97587c4123539b43e6d1e1c88b26d1f4e41b 100644 (file)
@@ -37,8 +37,18 @@ namespace nntrainer {
 class LazyTensor;
 
 /**
- * @class   Tensor Class
- * @brief   Tensor Class
+ * @class Tensor Class
+ * @brief Tensor is a multidimensional matrix that contain elements of a single
+ * data type and can perform various operations like addition, division,
+ * multiplication, dot product, data averaging, and more.
+ * NNTrainer defines tensor types using different data types and memory formats.
+ * Supported data types and format are specified in the file 'tensor_dim.h'.
+ *
+ * @note The Tensor class utilizes the TensorBase class to support tensors with
+ * various data types. In other words, this tensor class serves as a container
+ * for tensors, and thus the functionality of the tensor should be defined in
+ * each tensor class (FloatTensor, HalfTensor, etc.).
+ *
  */
 class Tensor {
 public:
index c3b4bfb87547e94922d113340f14e32a88ea883e..2cded86154e9610fa786c9444e0f2cf48ec87f56 100644 (file)
@@ -77,7 +77,17 @@ class SrcSharedTensorBase;
 
 /**
  * @class TensorBase class
- * @brief TensorBase is an abstract class
+ * @brief TensorBase is an abstract class that provides a base for various
+ * tensor classes with different data types such as FloatTensor to extend and
+ * implement abstract methods.
+ *
+ * @note Basic functions required for tensor memory allocation and data
+ * modification, such as allocate(), getData(), and setValue(), are necessary
+ * when creating subclasses (new tensor class).
+ *
+ * The remaining operations that are used for mathematical operations are not
+ * essential to create a new tensor class but later should be implemented in a
+ * child class in order to utilize its tensor operations fully.
  */
 class TensorBase {
 public: