提交 d054a5ee 编写于 作者: F fengjiayi

re-submit

上级 e146fe83
......@@ -30,7 +30,7 @@ class Tensor {
template <typename T>
const T* data() const {
PADDLE_ENFORCE(holder_ != nullptr,
"Tensor::data must be called after Tensor::mutable_data");
"Tensor::data must be called after Tensor::mutable_data.");
return static_cast<const T*>(holder_->Ptr());
}
......
......@@ -23,7 +23,7 @@ TEST(Tensor, ASSERT) {
const double* p __attribute__((unused)) = cpu_tensor.data<double>();
} catch (paddle::framework::EnforceNotMet err) {
caught = true;
std::string msg = "Tensor::data must be called after Tensor::mutable_data";
std::string msg = "Tensor::data must be called after Tensor::mutable_data.";
const char* what = err.what();
for (size_t i = 0; i < msg.length(); ++i) {
ASSERT_EQ(what[i], msg[i]);
......@@ -82,4 +82,4 @@ TEST(Tensor, MutableData) {
EXPECT_EQ(p1, p2);
}
}
*/
\ No newline at end of file
*/
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册