@@ -381,6 +381,8 @@ struct Input : torch::CustomClassHolder {
381
381
DataType dtype;
382
382
// / Expected tensor format for the input
383
383
TensorFormat format;
384
+ // / Expected allowed domain for tensor input
385
+ std::vector<double > tensor_domain;
384
386
385
387
Input () {}
386
388
/* *
@@ -394,6 +396,22 @@ struct Input : torch::CustomClassHolder {
394
396
*/
395
397
TORCHTRT_API Input (std::vector<int64_t > shape, TensorFormat format = TensorFormat::kContiguous );
396
398
399
+ /* *
400
+ * @brief Construct a new Input spec object for static input size from
401
+ * c10::ArrayRef (the type produced by tensor.sizes()), vector, optional arguments
402
+ * allow the user to configure expected input shape tensor format
403
+ * dtype (Expected data type for the input) defaults to PyTorch
404
+ * / traditional TRT convection (FP32 for FP32 only, FP16 for FP32 and FP16, FP32 for Int8)
405
+ *
406
+ * @param shape Input tensor shape
407
+ * @param tensor_domain Allowed range for tensor inputs [low, high)
408
+ * @param format Expected tensor format for the input (Defaults to contiguous)
409
+ */
410
+ TORCHTRT_API Input (
411
+ std::vector<int64_t > shape,
412
+ std::vector<double > tensor_domain,
413
+ TensorFormat format = TensorFormat::kContiguous );
414
+
397
415
/* *
398
416
* @brief Construct a new Input spec object for static input size from
399
417
* vector, optional arguments allow the user to configure expected input shape
@@ -406,6 +424,23 @@ struct Input : torch::CustomClassHolder {
406
424
*/
407
425
TORCHTRT_API Input (std::vector<int64_t > shape, DataType dtype, TensorFormat format = TensorFormat::kContiguous );
408
426
427
+ /* *
428
+ * @brief Construct a new Input spec object for static input size from
429
+ * vector, optional arguments allow the user to configure expected input shape
430
+ * tensor format
431
+ *
432
+ * @param shape Input tensor shape
433
+ * @param dtype Expected data type for the input (Defaults to the type of the weights in the first tensor
434
+ * calculation if detectable else Float32)
435
+ * @param tensor_domain Allowed range for tensor inputs [low, high)
436
+ * @param format Expected tensor format for the input (Defaults to contiguous)
437
+ */
438
+ TORCHTRT_API Input (
439
+ std::vector<int64_t > shape,
440
+ DataType dtype,
441
+ std::vector<double > tensor_domain,
442
+ TensorFormat format = TensorFormat::kContiguous );
443
+
409
444
/* *
410
445
* @brief Construct a new Input spec object for static input size from
411
446
* c10::ArrayRef (the type produced by tensor.sizes()), vector, optional arguments
@@ -418,6 +453,22 @@ struct Input : torch::CustomClassHolder {
418
453
*/
419
454
TORCHTRT_API Input (c10::ArrayRef<int64_t > shape, TensorFormat format = TensorFormat::kContiguous );
420
455
456
+ /* *
457
+ * @brief Construct a new Input spec object for static input size from
458
+ * c10::ArrayRef (the type produced by tensor.sizes()), vector, optional arguments
459
+ * allow the user to configure expected input shape tensor format
460
+ * dtype (Expected data type for the input) defaults to PyTorch
461
+ * / traditional TRT convection (FP32 for FP32 only, FP16 for FP32 and FP16, FP32 for Int8)
462
+ *
463
+ * @param shape Input tensor shape
464
+ * @param tensor_domain Allowed range for tensor inputs [low, high)
465
+ * @param format Expected tensor format for the input (Defaults to contiguous)
466
+ */
467
+ TORCHTRT_API Input (
468
+ c10::ArrayRef<int64_t > shape,
469
+ std::vector<double > tensor_domain,
470
+ TensorFormat format = TensorFormat::kContiguous );
471
+
421
472
/* *
422
473
* @brief Construct a new Input spec object for static input size from
423
474
* c10::ArrayRef (the type produced by tensor.sizes()), vector, optional arguments
@@ -430,6 +481,23 @@ struct Input : torch::CustomClassHolder {
430
481
*/
431
482
TORCHTRT_API Input (c10::ArrayRef<int64_t > shape, DataType dtype, TensorFormat format = TensorFormat::kContiguous );
432
483
484
+ /* *
485
+ * @brief Construct a new Input spec object for static input size from
486
+ * c10::ArrayRef (the type produced by tensor.sizes()), vector, optional arguments
487
+ * allow the user to configure expected input shape tensor format
488
+ *
489
+ * @param shape Input tensor shape
490
+ * @param dtype Expected data type for the input (Defaults to the type of the weights in the first tensor
491
+ * calculation if detectable else Float32)
492
+ * @param tensor_domain Allowed range for tensor inputs [low, high)
493
+ * @param format Expected tensor format for the input (Defaults to contiguous)
494
+ */
495
+ TORCHTRT_API Input (
496
+ c10::ArrayRef<int64_t > shape,
497
+ DataType dtype,
498
+ std::vector<double > tensor_domain,
499
+ TensorFormat format = TensorFormat::kContiguous );
500
+
433
501
/* *
434
502
* @brief Construct a new Input spec object dynamic input size from
435
503
* c10::ArrayRef (the type produced by tensor.sizes()) for min, opt, and max
@@ -446,6 +514,24 @@ struct Input : torch::CustomClassHolder {
446
514
std::vector<int64_t > opt_shape,
447
515
std::vector<int64_t > max_shape,
448
516
TensorFormat format = TensorFormat::kContiguous );
517
+ /* *
518
+ * @brief Construct a new Input spec object dynamic input size from
519
+ * c10::ArrayRef (the type produced by tensor.sizes()) for min, opt, and max
520
+ * supported sizes. dtype (Expected data type for the input) defaults to PyTorch
521
+ * / traditional TRT convection (FP32 for FP32 only, FP16 for FP32 and FP16, FP32 for Int8)
522
+ *
523
+ * @param min_shape Minimum shape for input tensor
524
+ * @param opt_shape Target optimization shape for input tensor
525
+ * @param max_shape Maximum acceptible shape for input tensor
526
+ * @param tensor_domain Allowed range for tensor inputs [low, high)
527
+ * @param format Expected tensor format for the input (Defaults to contiguous)
528
+ */
529
+ TORCHTRT_API Input (
530
+ std::vector<int64_t > min_shape,
531
+ std::vector<int64_t > opt_shape,
532
+ std::vector<int64_t > max_shape,
533
+ std::vector<double > tensor_domain,
534
+ TensorFormat format = TensorFormat::kContiguous );
449
535
450
536
/* *
451
537
* @brief Construct a new Input spec object for a dynamic input size from vectors
@@ -466,6 +552,44 @@ struct Input : torch::CustomClassHolder {
466
552
DataType dtype,
467
553
TensorFormat format = TensorFormat::kContiguous );
468
554
555
+ /* *
556
+ * @brief Construct a new Input spec object for a dynamic input size from vectors
557
+ * for minimum shape, optimal shape, and max shape supported sizes optional arguments
558
+ * allow the user to configure expected input shape tensor format
559
+ *
560
+ * @param min_shape Minimum shape for input tensor
561
+ * @param opt_shape Target optimization shape for input tensor
562
+ * @param max_shape Maximum acceptible shape for input tensor
563
+ * @param dtype Expected data type for the input (Defaults to the type of the weights in the first tensor
564
+ * calculation if detectable else Float32)
565
+ * @param tensor_domain Allowed range for tensor inputs [low, high)
566
+ * @param format Expected tensor format for the input (Defaults to contiguous)
567
+ */
568
+ TORCHTRT_API Input (
569
+ std::vector<int64_t > min_shape,
570
+ std::vector<int64_t > opt_shape,
571
+ std::vector<int64_t > max_shape,
572
+ DataType dtype,
573
+ std::vector<double > tensor_domain,
574
+ TensorFormat format = TensorFormat::kContiguous );
575
+
576
+ /* *
577
+ * @brief Construct a new Input spec object dynamic input size from
578
+ * c10::ArrayRef (the type produced by tensor.sizes()) for min, opt, and max
579
+ * supported sizes. dtype (Expected data type for the input) defaults to PyTorch
580
+ * / traditional TRT convection (FP32 for FP32 only, FP16 for FP32 and FP16, FP32 for Int8)
581
+ *
582
+ * @param min_shape Minimum shape for input tensor
583
+ * @param opt_shape Target optimization shape for input tensor
584
+ * @param max_shape Maximum acceptible shape for input tensor
585
+ * @param format Expected tensor format for the input (Defaults to contiguous)
586
+ */
587
+ TORCHTRT_API Input (
588
+ c10::ArrayRef<int64_t > min_shape,
589
+ c10::ArrayRef<int64_t > opt_shape,
590
+ c10::ArrayRef<int64_t > max_shape,
591
+ TensorFormat format = TensorFormat::kContiguous );
592
+
469
593
/* *
470
594
* @brief Construct a new Input spec object dynamic input size from
471
595
* c10::ArrayRef (the type produced by tensor.sizes()) for min, opt, and max
@@ -475,12 +599,33 @@ struct Input : torch::CustomClassHolder {
475
599
* @param min_shape Minimum shape for input tensor
476
600
* @param opt_shape Target optimization shape for input tensor
477
601
* @param max_shape Maximum acceptible shape for input tensor
602
+ * @param tensor_domain Allowed range for tensor inputs [low, high)
478
603
* @param format Expected tensor format for the input (Defaults to contiguous)
479
604
*/
480
605
TORCHTRT_API Input (
481
606
c10::ArrayRef<int64_t > min_shape,
482
607
c10::ArrayRef<int64_t > opt_shape,
483
608
c10::ArrayRef<int64_t > max_shape,
609
+ std::vector<double > tensor_domain,
610
+ TensorFormat format = TensorFormat::kContiguous );
611
+
612
+ /* *
613
+ * @brief Construct a new Input spec object dynamic input size from
614
+ * c10::ArrayRef (the type produced by tensor.sizes()) for min, opt, and max
615
+ * supported sizes
616
+ *
617
+ * @param min_shape Minimum shape for input tensor
618
+ * @param opt_shape Target optimization shape for input tensor
619
+ * @param max_shape Maximum acceptible shape for input tensor
620
+ * @param dtype Expected data type for the input (Defaults to the type of the weights in the first tensor
621
+ * calculation if detectable else Float32)
622
+ * @param format Expected tensor format for the input (Defaults to contiguous)
623
+ */
624
+ TORCHTRT_API Input (
625
+ c10::ArrayRef<int64_t > min_shape,
626
+ c10::ArrayRef<int64_t > opt_shape,
627
+ c10::ArrayRef<int64_t > max_shape,
628
+ DataType dtype,
484
629
TensorFormat format = TensorFormat::kContiguous );
485
630
486
631
/* *
@@ -493,13 +638,15 @@ struct Input : torch::CustomClassHolder {
493
638
* @param max_shape Maximum acceptible shape for input tensor
494
639
* @param dtype Expected data type for the input (Defaults to the type of the weights in the first tensor
495
640
* calculation if detectable else Float32)
641
+ * @param tensor_domain Allowed range for tensor inputs [low, high)
496
642
* @param format Expected tensor format for the input (Defaults to contiguous)
497
643
*/
498
644
TORCHTRT_API Input (
499
645
c10::ArrayRef<int64_t > min_shape,
500
646
c10::ArrayRef<int64_t > opt_shape,
501
647
c10::ArrayRef<int64_t > max_shape,
502
648
DataType dtype,
649
+ std::vector<double > tensor_domain,
503
650
TensorFormat format = TensorFormat::kContiguous );
504
651
505
652
/* *
0 commit comments