*/
void printPreset(std::ostream &out, unsigned int preset);
- /**
- * @brief print metrics function for neuralnet
- * @param[in] out outstream
- * @param[in] flags verbosity from ml_train_summary_type_e
- */
- void printMetrics(std::ostream &out, unsigned int flags = 0);
-
private:
/**
* @brief Print Options when printing layer info
* @brief Update batch size of the model as well as its layers/dataset
*/
void setBatchSize(unsigned int batch_size);
+
+ /**
+ * @brief print metrics function for neuralnet
+ * @param[in] out outstream
+ * @param[in] flags verbosity from ml_train_summary_type_e
+ */
+ void printMetrics(std::ostream &out, unsigned int flags = 0);
};
} /* namespace nntrainer */
class LazyTensor;
/**
- * @struct External Loop Info for broadcasted info
- * @brief External Loop Info for broadcasted iteration. Please refer to
- * DISABLED_private_external_loop_n in unittest_nntrainer_tensor.
- * @note This should better be implemented in iterator fashion before used
- * extensively.
- */
-struct BroadcastInfo {
-
- /**
- * @brief Construct a new External Loop Info object
- *
- */
- BroadcastInfo() : strides{0, 0, 0, 0} {}
-
- unsigned int buffer_size; /**< virtual size of the buffer */
- int buffer_axis; /**< the smallest axis that should be looped.
- -1 means no loop needed*/
- std::array<unsigned int, MAXDIM>
- strides; /**< modified strides for the loop */
-};
-
-/**
* @class Tensor Class for Calculation
* @brief Tensor Class for Calculation
*/
return (b * strides[0] + c * strides[1] + h * strides[2] + w * strides[3]);
}
+ struct BroadcastInfo;
+
/**
* @brief Applies the given operator to the tensor with the passed argument
* @param[in] m Tensor
Tensor Tensor::add(float const &value) { CLONE_OP_I(add_i, value); }
/**
+ * @struct External Loop Info for broadcasted info
+ * @brief External Loop Info for broadcasted iteration. Please refer to
+ * DISABLED_private_external_loop_n in unittest_nntrainer_tensor.
+ * @note This should better be implemented in iterator fashion before used
+ * extensively.
+ */
+struct Tensor::BroadcastInfo {
+
+ /**
+ * @brief Construct a new External Loop Info object
+ *
+ */
+ BroadcastInfo() : strides{0, 0, 0, 0} {}
+
+ unsigned int buffer_size; /**< virtual size of the buffer */
+ int buffer_axis; /**< the smallest axis that should be looped.
+ -1 means no loop needed*/
+ std::array<unsigned int, MAXDIM>
+ strides; /**< modified strides for the loop */
+};
+
+/**
* @brief Add Tensor Element by Element without mem copy
* @param[in] m Tensor to be added
* #retval #ML_ERROR_NONE Successful
return result;
}
-BroadcastInfo Tensor::computeBroadcastInfo(const Tensor &m) {
+Tensor::BroadcastInfo Tensor::computeBroadcastInfo(const Tensor &m) {
if (m.length() > this->length())
throw exception::not_supported("broadcasting *this is not supported");