Skip to content

# Class ExtraInfo::DataType

- Defined in File trtorch.h

## Nested Relationships

This class is a nested type of Struct ExtraInfo .

## Class Documentation

class `trtorch:: ExtraInfo `::`` `DataType`

  Supported Data Types that can be used with TensorRT engines

  This class is compatable with c10::DataTypes (but will check for TRT support) so there should not be a reason that you need to use this type explictly.

  Public Types

  enum `Value`

    Underlying enum class to support the DataType Class

    In the case that you need to use the DataType class itself, interface using this enum vs. normal instatination

    ex. trtorch::DataType type = DataType::kFloat ;

    Values:

    enumerator `kFloat`

      FP32.

    enumerator `kHalf`

      FP16.

    enumerator `kChar`

      INT8.

  Public Functions

  `DataType` ( ) = default

    Construct a new Data Type object.

  constexpr `DataType` ( Value t )

    DataType constructor from enum.

  `DataType` ( c10::ScalarType t )

    Construct a new Data Type object from torch type enums.

    Parameters

      - `t` :

  `operator Value` ( ) const

    Get the enum value of the DataType object.

    Return

      Value

  `operator bool` ( ) = delete
  constexpr bool `operator==` ( DataType other ) const

    Comparision operator for DataType .

    Return

      true

    Return

      false

    Parameters

      - `other` :

  constexpr bool `operator==` ( DataType :: Value other ) const

    Comparision operator for DataType .

    Return

      true

    Return

      false

    Parameters

      - `other` :

  constexpr bool `operator!=` ( DataType other ) const

    Comparision operator for DataType .

    Return

      true

    Return

      false

    Parameters

      - `other` :

  constexpr bool `operator!=` ( DataType :: Value other ) const

    Comparision operator for DataType .

    Return

      true

    Return

      false

    Parameters

      - `other` :