How to access a Tensor of a class derived from torch::nn::Module

I have a class derived from torch::nn::Module. In the constructor I define a Tensor and I register it as buffer: this->register_buffer(“pe”, pe);

I need to get it for modifiying… I have used: auto pe_buffer= this->named_buffers()[“pe”];

but I can’t modify it this way.

Any help would be appreciated.