mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
Pull Request resolved: https://github.com/pytorch/pytorch/pull/166079 Approved by: https://github.com/malfet, https://github.com/cyyever ghstack dependencies: #166076, #166077, #166078
24 lines
483 B
C++
24 lines
483 B
C++
#pragma once
|
|
#include <cstdint>
|
|
|
|
#include <torch/headeronly/macros/Macros.h>
|
|
|
|
namespace c10 {
|
|
|
|
/**
|
|
* quint4x2 is for un-signed 4 bit quantized Tensors that are packed to byte
|
|
* boundary.
|
|
*/
|
|
struct alignas(1) quint4x2 {
|
|
using underlying = uint8_t;
|
|
uint8_t val_;
|
|
quint4x2() = default;
|
|
C10_HOST_DEVICE explicit quint4x2(uint8_t val) : val_(val) {}
|
|
};
|
|
|
|
} // namespace c10
|
|
|
|
HIDDEN_NAMESPACE_BEGIN(torch, headeronly)
|
|
using c10::quint4x2;
|
|
HIDDEN_NAMESPACE_END(torch, headeronly)
|