Files
pytorch/torch/headeronly/util/quint8.h
Jane Xu 96ac64d00c Migrate easy q(u)int/bits stuff to torch/headeronly (#159302)
Straightup copy pasta. Keeps APIs in c10 and reexposes them to torch::headeronly.

It is arguable that we should just get rid of some of these unused dtypes but that is outside the scope of this PR, which is meant to build up to ScalarType moving to headeronly.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/159302
Approved by: https://github.com/malfet, https://github.com/albanD
2025-07-30 03:41:27 +00:00

23 lines
416 B
C++

#pragma once
#include <cstdint>
#include <torch/headeronly/macros/Macros.h>
namespace c10 {
/**
* quint8 is for unsigned 8 bit quantized Tensors
*/
struct alignas(1) quint8 {
using underlying = uint8_t;
uint8_t val_;
quint8() = default;
C10_HOST_DEVICE explicit quint8(uint8_t val) : val_(val) {}
};
} // namespace c10
namespace torch::headeronly {
using c10::quint8;
} // namespace torch::headeronly