mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
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
23 lines
415 B
C++
23 lines
415 B
C++
#pragma once
|
|
#include <cstdint>
|
|
|
|
#include <torch/headeronly/macros/Macros.h>
|
|
|
|
namespace c10 {
|
|
|
|
/**
|
|
* qint32 is for signed 32 bit quantized Tensors
|
|
*/
|
|
struct alignas(4) qint32 {
|
|
using underlying = int32_t;
|
|
int32_t val_;
|
|
qint32() = default;
|
|
C10_HOST_DEVICE explicit qint32(int32_t val) : val_(val) {}
|
|
};
|
|
|
|
} // namespace c10
|
|
|
|
namespace torch::headeronly {
|
|
using c10::qint32;
|
|
} // namespace torch::headeronly
|