magical buffer -> tensor functions.