Solved by chenyuntc in post #6 
              
              
                You can not do it directly in variable.data, It will raise error of size-dismatch when backward. 
Try  variable[1:257,1:257]  if you know what you are doing.