sorry for that I did not make this clear enough.
For shift[0], i mean shift is a python list to store python float number, and so is a scala
and it is true that shift[0] is on CPU.  BUT it seems right that a gpu tensor could operate with python number, right?
and for this, I mean that python float number can only controlled by cpu and there is no need to convert them to gpu tensor to operate with gpu float tensor p.anchor_tensor[i,0], right?