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