You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor!: Removing deprecated InputRange, op_precision and input_shapes
APIs
BREAKING CHANGE: This removes the InputRange Class and op_precision and
input shape fields which were deprecated in TRTorch v0.4.0
Signed-off-by: Naren Dasan <[email protected]>
Signed-off-by: Naren Dasan <[email protected]>
* @brief A struct to hold an input range (used by TensorRT Optimization
511
-
* profile)
512
-
*
513
-
* This struct can either hold a single vector representing an input shape,
514
-
* signifying a static input shape or a set of three input shapes representing
515
-
* the min, optiminal and max input shapes allowed for the engine.
516
-
*/
517
-
structTRTORCH_API InputRange {
518
-
/// Minimum acceptable input size into the engine
519
-
std::vector<int64_t> min;
520
-
/// Optimal input size into the engine (gets best performace)
521
-
std::vector<int64_t> opt;
522
-
/// Maximum acceptable input size into the engine
523
-
std::vector<int64_t> max;
524
-
/**
525
-
* @brief Construct a new Input Range object for static input size from
526
-
* vector
527
-
*
528
-
* @param opt
529
-
*/
530
-
[[deprecated("trtorch::CompileSpec::InputRange is being deprecated in favor of trtorch::CompileSpec::Input. trtorch::CompileSpec::InputRange will be removed in TRTorch v0.5.0")]] InputRange(
531
-
std::vector<int64_t> opt);
532
-
/**
533
-
* @brief Construct a new Input Range object static input size from
534
-
* c10::ArrayRef (the type produced by tensor.sizes())
535
-
*
536
-
* @param opt
537
-
*/
538
-
[[deprecated("trtorch::CompileSpec::InputRange is being deprecated in favor of trtorch::CompileSpec::Input. trtorch::CompileSpec::InputRange will be removed in TRTorch v0.5.0")]] InputRange(
539
-
c10::ArrayRef<int64_t> opt);
540
-
/**
541
-
* @brief Construct a new Input Range object dynamic input size from vectors
542
-
* for min, opt, and max supported sizes
543
-
*
544
-
* @param min
545
-
* @param opt
546
-
* @param max
547
-
*/
548
-
[[deprecated("trtorch::CompileSpec::InputRange is being deprecated in favor of trtorch::CompileSpec::Input. trtorch::CompileSpec::InputRange will be removed in TRTorch v0.5.0")]] InputRange(
549
-
std::vector<int64_t> min,
550
-
std::vector<int64_t> opt,
551
-
std::vector<int64_t> max);
552
-
/**
553
-
* @brief Construct a new Input Range object dynamic input size from
554
-
* c10::ArrayRef (the type produced by tensor.sizes()) for min, opt, and max
555
-
* supported sizes
556
-
*
557
-
* @param min
558
-
* @param opt
559
-
* @param max
560
-
*/
561
-
[[deprecated("trtorch::CompileSpec::InputRange is being deprecated in favor of trtorch::CompileSpec::Input. trtorch::CompileSpec::InputRange will be removed in TRTorch v0.5.0")]] InputRange(
* @brief Construct a new Extra Info object from input ranges.
601
-
* Each entry in the vector represents a input and should be provided in call
602
-
* order.
603
-
*
604
-
* Use this constructor if you want to use dynamic shape
605
-
*
606
-
* @param input_ranges
607
-
*/
608
-
[[deprecated("trtorch::CompileSpec::CompileSpec(std::vector<InputRange> input_ranges) is being deprecated in favor of trtorch::CompileSpec::CompileSpec(std::vector<Input> inputs). Please use CompileSpec(std::vector<Input> inputs). trtorch::CompileSpec::CompileSpec(std::vector<InputRange> input_ranges) will be removed in TRTorch v0.5.0")]] CompileSpec(
609
-
std::vector<InputRange> input_ranges)
610
-
: input_ranges(std::move(input_ranges)) {}
611
541
/**
612
542
* @brief Construct a new Extra Info object
613
543
* Convienence constructor to set fixed input size from vectors describing
* Sizes for inputs to engine, can either be a single size or a range
662
-
* defined by Min, Optimal, Max sizes
663
-
*
664
-
* Order is should match call order
665
-
*/
666
-
[[deprecated(
667
-
"trtorch::CompileSpec::input_ranges is being deprecated in favor of trtorch::CompileSpec::inputs. trtorch::CompileSpec::input_ranges will be removed in TRTorch v0.5.0")]] std::
668
-
vector<InputRange>
669
-
input_ranges;
670
-
671
-
/**
672
-
* Default operating precision for the engine
673
-
*/
674
-
[[deprecated(
675
-
"trtorch::CompileSpec::op_precision is being deprecated in favor of trtorch::CompileSpec::enabled_precisions, a set of all enabled precisions to use during compilation, trtorch::CompileSpec::op_precision will be removed in TRTorch v0.5.0")]] DataType
676
-
op_precision = DataType::kFloat;
677
-
678
590
/**
679
591
* @brief The set of precisions TensorRT is allowed to use for kernels during compilation
if (external.input_ranges.size() > 0 && external.inputs.size() > 0) {
332
-
TRTORCH_THROW_ERROR(
333
-
"Saw both input specs listed for inputs and input_ranges in CompileSpec. input_ranges is deprecated and will be removed in v0.5.0. Please port forward to using inputs");
"Found both key \"op_precision\", and \"enabled_precisions\" in compile spec, please port forward to using only \"enabled_precisions\""
182
171
)
183
172
184
-
if"op_precision"incompile_spec:
185
-
warnings.warn(
186
-
"Key \"op_precision\" is being deprecated in favor of \"enabled_precision\" which expects a set of precisions to be enabled during compilation (FP32 will always be enabled), Support for \"op_precision\" will be removed in TRTorch v0.5.0",
0 commit comments