Shape, datatype, and byte-size metadata for one model tensor.
More...
#include <types.hpp>
Shape, datatype, and byte-size metadata for one model tensor.
Definition at line 272 of file types.hpp.
◆ InputOutputMetaData()
| triton_cpp::InputOutputMetaData::InputOutputMetaData |
( |
const std::vector< int64_t > & | shape, |
|
|
const inference::DataType & | datatype ) |
|
inline |
Build metadata and calculate the required tensor byte size.
- Parameters
-
| shape | Tensor dimensions. Dynamic dimensions contribute one to the size. |
| datatype | Triton tensor datatype. |
- Exceptions
-
| std::invalid_argument | if datatype is unsupported. |
Definition at line 287 of file types.hpp.
291 std::visit([](
auto&& arg) {
return static_cast<std::int64_t
>(
sizeof(arg)); },
getZero(
datatype))} {}
TritonDataType getZero(inference::DataType type)
Get a zero value in the correct C++ type, given a Triton datatype.
std::int64_t accumulate_shape(It begin, It end)
Compute the element count represented by a tensor shape.
◆ bytesize
| const int64_t triton_cpp::InputOutputMetaData::bytesize |
Total tensor buffer size in bytes.
Definition at line 278 of file types.hpp.
◆ datatype
| const inference::DataType triton_cpp::InputOutputMetaData::datatype |
Triton tensor datatype.
Definition at line 276 of file types.hpp.
◆ shape
| const std::vector<int64_t> triton_cpp::InputOutputMetaData::shape |
Tensor dimensions reported by Triton or supplied by the caller.
Definition at line 274 of file types.hpp.
The documentation for this struct was generated from the following file: