| 76 | } |
| 77 | |
| 78 | const dtype::pstring* StringTensor::data() const { |
| 79 | PADDLE_ENFORCE_NOT_NULL( |
| 80 | holder_, |
| 81 | common::errors::PreconditionNotMet( |
| 82 | "The storage must be valid when call the mutable data function.")); |
| 83 | uintptr_t ptr = reinterpret_cast<uintptr_t>(holder_->ptr()) + meta_.offset; |
| 84 | return reinterpret_cast<const dtype::pstring*>(ptr); |
| 85 | } |
| 86 | |
| 87 | dtype::pstring* StringTensor::data() { |
| 88 | PADDLE_ENFORCE_NOT_NULL( |