In Tensorflow when one writes a custom op in C++, one is provided with a pointer to the input from the context. The pointer resides on CPU or GPU depending on device. My question is can you modify the memory buffer pointed to by the pointer in the op. For example, can I do in place parallel reduction on the GPU? Will this mess up the input for other operations?