Helper function to check common tensor properties
| 5 | |
| 6 | // Helper function to check common tensor properties |
| 7 | void check_tensor(const torch::Tensor& tensor, const std::string& name) { |
| 8 | TORCH_CHECK(tensor.is_cuda(), name, " must be a CUDA tensor"); |
| 9 | TORCH_CHECK(tensor.dtype() == torch::kBFloat16, name, " must have bfloat16 dtype"); |
| 10 | TORCH_CHECK(tensor.is_contiguous(), name, " must be contiguous"); |
| 11 | } |
| 12 | |
| 13 | /** |
| 14 | * @brief Python-bindable 'run' function for RMSNorm. |