#ifndef PADDLE_OPTIMIZER_TENSOR_H_ #define PADDLE_OPTIMIZER_TENSOR_H_ /** * @brief tensor used by optimizer */ #include #include "paddle/math/BaseMatrix.h" namespace paddle { namespace optimizer { template using TensorBase = BaseMatrixT; template class Tensor : public TensorBase { public: Tensor(T* data, int size) : TensorBase(size, 1, 0, data, false, false) {} T* get_buffer() { return this->data_; } // TODO: replace with tensorshape size_t width() { return this->width_; } }; } // namespace optimizer } // namespace paddle #endif