MCPcopy Create free account
hub / github.com/NVIDIA/SOL-ExecBench / check_tensor

Function check_tensor

examples/cuda_cpp/rmsnorm/main.cpp:7–11  ·  view source on GitHub ↗

Helper function to check common tensor properties

Source from the content-addressed store, hash-verified

5
6// Helper function to check common tensor properties
7void 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.

Callers 1

runFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected