diff --git a/paddle/phi/kernels/funcs/broadcast_function.h b/paddle/phi/kernels/funcs/broadcast_function.h index 96e93c7a97ff12..167be9f2e0d74e 100644 --- a/paddle/phi/kernels/funcs/broadcast_function.h +++ b/paddle/phi/kernels/funcs/broadcast_function.h @@ -584,7 +584,7 @@ static void SliceTensor(DenseTensor *x, DenseTensorMeta meta(share->dtype(), new_dim, share->layout(), - offset * SizeOf(share->dtype())); + offset * SizeOf(share->dtype()) + share->offset()); x->set_meta(meta); x->ShareBufferWith(*(share), true); x->Resize(new_dim);