TensorType
==========

TensorType类用以定义输入或者输出支持的数据类型，TensorType提供以下接口指定支持的数据类型：

struct TensorType {
  explicit TensorType(DataType dt);
 
  TensorType(const std::initializer\_list<DataType> &initial\_types);
 
  static TensorType ALL() {
    return TensorType{DT\_BOOL,   DT\_COMPLEX128, DT\_COMPLEX64, DT\_DOUBLE, DT\_FLOAT,  DT\_FLOAT16, DT\_INT16,
                      DT\_INT32,  DT\_INT64,      DT\_INT8,      DT\_QINT16, DT\_QINT32, DT\_QINT8,   DT\_QUINT16,
                      DT\_QUINT8, DT\_RESOURCE,   DT\_STRING,    DT\_UINT16, DT\_UINT32, DT\_UINT64,  DT\_UINT8,
                      DT\_BF16, DT\_COMPLEX32};
  }
 
  static TensorType QuantifiedType() { return TensorType{DT\_QINT16, DT\_QINT32, DT\_QINT8, DT\_QUINT16, DT\_QUINT8}; }
 
  static TensorType OrdinaryType() {
    return TensorType{DT\_BOOL,  DT\_COMPLEX128, DT\_COMPLEX64, DT\_DOUBLE, DT\_FLOAT,  DT\_FLOAT16, DT\_INT16,
                      DT\_INT32, DT\_INT64,      DT\_INT8,      DT\_UINT16, DT\_UINT32, DT\_UINT64,  DT\_UINT8,
                      DT\_BF16, DT\_COMPLEX32};
  }
 
  static TensorType BasicType() {
    return TensorType{DT\_COMPLEX128, DT\_COMPLEX64, DT\_DOUBLE, DT\_FLOAT,  DT\_FLOAT16, DT\_INT16,
                      DT\_INT32,      DT\_INT64,     DT\_INT8,   DT\_QINT16, DT\_QINT32,  DT\_QINT8,
                      DT\_QUINT16,    DT\_QUINT8,    DT\_UINT16, DT\_UINT32, DT\_UINT64,  DT\_UINT8,
                      DT\_BF16, DT\_COMPLEX32};
  }
 
  static TensorType NumberType() {
    return TensorType{DT\_COMPLEX128, DT\_COMPLEX64, DT\_DOUBLE, DT\_FLOAT,  DT\_FLOAT16, DT\_INT16,  DT\_INT32,  DT\_INT64,
                      DT\_INT8,       DT\_QINT32,    DT\_QINT8,  DT\_QUINT8, DT\_UINT16,  DT\_UINT32, DT\_UINT64, DT\_UINT8,
                      DT\_BF16, DT\_COMPLEX32};
  }
 
  static TensorType RealNumberType() {
    return TensorType{DT\_DOUBLE, DT\_FLOAT,  DT\_FLOAT16, DT\_INT16,  DT\_INT32, DT\_INT64,
                      DT\_INT8,   DT\_UINT16, DT\_UINT32,  DT\_UINT64, DT\_UINT8, DT\_BF16};
  }
 
  static TensorType ComplexDataType() { return TensorType{DT\_COMPLEX128, DT\_COMPLEX64, DT\_COMPLEX32}; }
 
  static TensorType IntegerDataType() {
    return TensorType{DT\_INT16, DT\_INT32, DT\_INT64, DT\_INT8, DT\_UINT16, DT\_UINT32, DT\_UINT64, DT\_UINT8};
  }
 
  static TensorType SignedDataType() { return TensorType{DT\_INT16, DT\_INT32, DT\_INT64, DT\_INT8}; }
 
  static TensorType UnsignedDataType() { return TensorType{DT\_UINT16, DT\_UINT32, DT\_UINT64, DT\_UINT8}; }
 
  static TensorType FloatingDataType() { return TensorType{DT\_DOUBLE, DT\_FLOAT, DT\_FLOAT16}; }
 
  static TensorType IndexNumberType() { return TensorType{DT\_INT32, DT\_INT64}; }
 
  static TensorType UnaryDataType() {
    return TensorType{DT\_COMPLEX128, DT\_COMPLEX64, DT\_DOUBLE, DT\_FLOAT, DT\_FLOAT16, DT\_BF16, DT\_COMPLEX32};
  }
 
  static TensorType FLOAT() { return TensorType{DT\_FLOAT, DT\_FLOAT16, DT\_BF16}; }
 
  std::shared\_ptr<TensorTypeImpl> tensor\_type\_impl\_;
};