o dtype promotion works properly. if (tensor.unsafeGetTensorImpl()->is_wrapped_number()) { out.unsafeGetTensorImpl()->set_wrapped_number(true); } return out; } c10::optional to_meta(const c10::optional& tensor) { if (tensor.has_value()) { return to_meta(*tensor); } return c10::nullopt; } std::vector to_meta(at::ITensorListRef t_list) { std::vector outs; outs.reserve(t_list.size()); for (const auto& tensor : t_list) { outs.push_back(to_meta(tensor)); } return outs; } r,