MCPcopy Create free account
hub / github.com/deepspeedai/DeepSpeed / get_scales

Function get_scales

csrc/fp_quantizer/fp_quantize.cpp:122–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

120}
121
122at::Tensor get_scales(torch::Tensor& out, int num_groups)
123{
124 auto options = at::TensorOptions()
125 .dtype(torch::kFloat)
126 .layout(at::kStrided)
127 .device(at::kCUDA)
128 .requires_grad(false);
129 auto scales =
130 torch::from_blob(out.data_ptr(), {num_groups, 1}, {out.stride(0) / 4, 1}, options);
131 return scales;
132}
133
134PYBIND11_MODULE(TORCH_EXTENSION_NAME, m)
135{

Callers

nothing calls this directly

Calls 3

deviceMethod · 0.45
dtypeMethod · 0.45
data_ptrMethod · 0.45

Tested by

no test coverage detected