结构体输入¶
继承关系¶
基本类型¶
public CustomClassHolder
结构体文档¶
-
struct Input : public CustomClassHolder¶
一个用于保存输入范围的结构体(由TensorRT优化配置文件使用)
此结构体可以包含表示输入形状的单个向量,表示静态输入形状,或者包含表示引擎允许的最小、最佳和最大输入形状的三个输入形状的集合。
公共函数
-
inline Input()¶
-
TORCHTRT_API Input(std::vector<int64_t> shape, TensorFormat format = TensorFormat::kContiguous)¶
为静态输入大小从向量构造一个新的输入规范对象,可选参数允许用户配置预期的输入形状张量格式。dtype(输入的预期数据类型)默认为PyTorch / 传统TRT对流(仅FP32为FP32,FP32和FP16为FP16,Int8为FP32)
- Parameters
shape – 输入 张量形状
format – 输入张量的预期格式(默认为连续格式)
-
TORCHTRT_API Input(std::vector<int64_t> shape, std::vector<double> tensor_domain, TensorFormat format = TensorFormat::kContiguous)¶
从c10::ArrayRef(由tensor.sizes()生成的类型)、向量构造一个新的输入规范对象,可选参数允许用户配置预期的输入形状张量格式数据类型(输入的预期数据类型)默认为PyTorch / 传统TRT对流(仅FP32为FP32,FP32和FP16为FP16,Int8为FP32)
- Parameters
shape – 输入 张量形状
tensor_domain – 张量输入的允许范围 [低, 高)
format – 输入张量的预期格式(默认为连续格式)
-
TORCHTRT_API Input(std::vector<int64_t> shape, 数据类型 dtype, TensorFormat format = TensorFormat::kContiguous)¶
为静态输入大小从向量构造一个新的输入规范对象,可选参数允许用户配置预期的输入形状张量格式。
- Parameters
shape – 输入 张量形状
dtype – 输入的预期数据类型(默认为第一个张量计算中权重的类型,如果可检测到,否则为Float32)
format – 输入张量的预期格式(默认为连续格式)
-
TORCHTRT_API Input(std::vector<int64_t> shape, 数据类型 dtype, std::vector<double> tensor_domain, TensorFormat format = TensorFormat::kContiguous)¶
为静态输入大小从向量构造一个新的输入规范对象,可选参数允许用户配置预期的输入形状张量格式。
- Parameters
shape – 输入 张量形状
dtype – 输入的预期数据类型(默认为第一个张量计算中权重的类型,如果可检测到,否则为Float32)
tensor_domain – 张量输入的允许范围 [低, 高)
format – 输入张量的预期格式(默认为连续格式)
-
TORCHTRT_API Input(c10::ArrayRef<int64_t> shape, TensorFormat format = TensorFormat::kContiguous)¶
从c10::ArrayRef(由tensor.sizes()生成的类型)、向量构造一个新的输入规范对象,可选参数允许用户配置预期的输入形状张量格式dtype(输入的预期数据类型)默认为PyTorch / 传统TRT对流(仅FP32为FP32,FP32和FP16为FP16,Int8为FP32)
- Parameters
shape – 输入 张量形状
format – 输入张量的预期格式(默认为连续格式)
-
TORCHTRT_API Input(c10::ArrayRef<int64_t> shape, std::vector<double> tensor_domain, TensorFormat format = TensorFormat::kContiguous)¶
从c10::ArrayRef(由tensor.sizes()生成的类型)、向量构造一个新的输入规范对象,可选参数允许用户配置预期的输入形状张量格式数据类型(输入的预期数据类型)默认为PyTorch / 传统TRT对流(仅FP32为FP32,FP32和FP16为FP16,Int8为FP32)
- Parameters
shape – 输入 张量形状
tensor_domain – 张量输入的允许范围 [低, 高)
format – 输入张量的预期格式(默认为连续格式)
-
TORCHTRT_API Input(c10::ArrayRef<int64_t> shape, 数据类型 dtype, TensorFormat format = TensorFormat::kContiguous)¶
从c10::ArrayRef(由tensor.sizes()生成的类型)、向量构造一个新的输入规范对象,可选参数允许用户配置预期的输入形状张量格式。
- Parameters
shape – 输入 张量形状
dtype – 输入的预期数据类型(如果可检测到,则默认为第一个张量计算中的权重类型,否则为Float32)
format – 输入张量的预期格式(默认为连续格式)
-
TORCHTRT_API Input(c10::ArrayRef<int64_t> shape, 数据类型 dtype, std::vector<double> tensor_domain, TensorFormat format = TensorFormat::kContiguous)¶
从c10::ArrayRef(由tensor.sizes()生成的类型)、向量构造一个新的输入规范对象,可选参数允许用户配置预期的输入形状张量格式。
- Parameters
shape – 输入 张量形状
dtype – 输入的预期数据类型(默认为第一个张量计算中权重的类型,如果可检测到,否则为Float32)
tensor_domain – 张量输入的允许范围 [低, 高)
format – 输入张量的预期格式(默认为连续格式)
-
TORCHTRT_API Input(std::vector<int64_t> min_shape, std::vector<int64_t> opt_shape, std::vector<int64_t> max_shape, TensorFormat format = TensorFormat::kContiguous)¶
从c10::ArrayRef(由tensor.sizes()生成的类型)构造一个新的输入规范对象,动态输入大小用于最小、最佳和最大支持的大小。dtype(输入的预期数据类型)默认为PyTorch / 传统TRT对流(仅FP32为FP32,FP32和FP16为FP16,Int8为FP32)
- Parameters
min_shape – 输入张量的最小形状
opt_shape – 输入张量的目标优化形状
max_shape – 输入张量的最大可接受形状
format – 输入张量的预期格式(默认为连续格式)
-
TORCHTRT_API Input(std::vector<int64_t> min_shape, std::vector<int64_t> opt_shape, std::vector<int64_t> max_shape, std::vector<double> tensor_domain, TensorFormat format = TensorFormat::kContiguous)¶
从c10::ArrayRef(由tensor.sizes()生成的类型)构造一个新的输入规范对象,动态输入大小用于最小、最佳和最大支持的大小。dtype(输入的预期数据类型)默认为PyTorch / 传统TRT转换(仅FP32为FP32,FP32和FP16为FP16,Int8为FP32)
- Parameters
min_shape – 输入张量的最小形状
opt_shape – 输入张量的目标优化形状
max_shape – 输入张量的最大可接受形状
tensor_domain – 张量输入的允许范围 [低, 高)
format – 输入张量的预期格式(默认为连续格式)
-
TORCHTRT_API Input(std::vector<int64_t> min_shape, std::vector<int64_t> opt_shape, std::vector<int64_t> max_shape, 数据类型 dtype, TensorFormat format = TensorFormat::kContiguous)¶
为动态输入大小构造一个新的输入规范对象,从最小形状、最佳形状和最大形状支持的向量中获取大小,可选参数允许用户配置预期的输入形状张量格式。
- Parameters
min_shape – 输入张量的最小形状
opt_shape – 输入张量的目标优化形状
max_shape – 输入张量的最大可接受形状
dtype – 输入的预期数据类型(默认为第一个张量计算中权重的类型,如果可检测到,否则为Float32)
format – 输入张量的预期格式(默认为连续格式)
-
TORCHTRT_API Input(std::vector<int64_t> min_shape, std::vector<int64_t> opt_shape, std::vector<int64_t> max_shape, 数据类型 dtype, std::vector<double> tensor_domain, TensorFormat format = TensorFormat::kContiguous)¶
为动态输入大小构建一个新的输入规范对象,从向量中获取最小形状、最佳形状和最大形状支持的大小,可选参数允许用户配置预期的输入形状张量格式。
- Parameters
min_shape – 输入张量的最小形状
opt_shape – 输入张量的目标优化形状
max_shape – 输入张量的最大可接受形状
dtype – 输入的预期数据类型(默认为第一个张量计算中权重的类型,如果可检测到,否则为Float32)
tensor_domain – 张量输入的允许范围 [低, 高)
format – 输入张量的预期格式(默认为连续格式)
-
TORCHTRT_API Input(c10::ArrayRef<int64_t> min_shape, c10::ArrayRef<int64_t> opt_shape, c10::ArrayRef<int64_t> max_shape, TensorFormat format = TensorFormat::kContiguous)¶
从c10::ArrayRef(由tensor.sizes()生成的类型)为最小、最佳和最大支持大小构造一个新的输入规范对象动态输入大小。dtype(输入的预期数据类型)默认为PyTorch / 传统TRT对流(仅FP32为FP32,FP32和FP16为FP16,Int8为FP32)
- Parameters
min_shape – 输入张量的最小形状
opt_shape – 输入张量的目标优化形状
max_shape – 输入张量的最大可接受形状
format – 输入张量的预期格式(默认为连续格式)
-
TORCHTRT_API Input(c10::ArrayRef<int64_t> min_shape, c10::ArrayRef<int64_t> opt_shape, c10::ArrayRef<int64_t> max_shape, std::vector<double> tensor_domain, TensorFormat format = TensorFormat::kContiguous)¶
从c10::ArrayRef(由tensor.sizes()生成的类型)构造一个新的输入规范对象,用于最小、最佳和最大支持大小的动态输入大小。dtype(输入的预期数据类型)默认为PyTorch / 传统TRT对流(仅FP32为FP32,FP32和FP16为FP16,Int8为FP32)。
- Parameters
min_shape – 输入张量的最小形状
opt_shape – 输入张量的目标优化形状
max_shape – 输入张量的最大可接受形状
tensor_domain – 张量输入的允许范围 [低, 高)
format – 输入张量的预期格式(默认为连续格式)
-
TORCHTRT_API Input(c10::ArrayRef<int64_t> min_shape, c10::ArrayRef<int64_t> opt_shape, c10::ArrayRef<int64_t> max_shape, 数据类型 dtype, TensorFormat format = TensorFormat::kContiguous)¶
从c10::ArrayRef(由tensor.sizes()生成的类型)构造一个新的输入规范对象,用于最小、最佳和最大支持大小的动态输入大小。
- Parameters
min_shape – 输入张量的最小形状
opt_shape – 输入张量的目标优化形状
max_shape – 输入张量的最大可接受形状
dtype – 输入的预期数据类型(默认为第一个张量计算中权重的类型,如果可检测到,否则为Float32)
format – 输入张量的预期格式(默认为连续格式)
-
TORCHTRT_API Input(c10::ArrayRef<int64_t> min_shape, c10::ArrayRef<int64_t> opt_shape, c10::ArrayRef<int64_t> max_shape, 数据类型 dtype, std::vector<double> tensor_domain, TensorFormat format = TensorFormat::kContiguous)¶
从c10::ArrayRef(由tensor.sizes()生成的类型)为最小、最佳和最大支持大小构造一个新的输入规范对象动态输入大小。
- Parameters
min_shape – 输入张量的最小形状
opt_shape – 输入张量的目标优化形状
max_shape – 输入张量的最大可接受形状
dtype – 输入的预期数据类型(默认为第一个张量计算中权重的类型,如果可检测到,否则为Float32)
tensor_domain – 张量输入的允许范围 [低, 高)
format – 输入张量的预期格式(默认为连续格式)
-
inline Input()¶