| 1107 | } |
| 1108 | |
| 1109 | bool RefLayerSupport::IsConvolution3dSupported(const TensorInfo& input, |
| 1110 | const TensorInfo& output, |
| 1111 | const Convolution3dDescriptor& descriptor, |
| 1112 | const TensorInfo& weights, |
| 1113 | const Optional<TensorInfo>& biases, |
| 1114 | Optional<std::string&> reasonIfUnsupported) const |
| 1115 | { |
| 1116 | bool supported = true; |
| 1117 | |
| 1118 | // Define supported types. |
| 1119 | std::array<DataType,7> supportedTypes = |
| 1120 | { |
| 1121 | DataType::Float32, |
| 1122 | DataType::Float16, |
| 1123 | DataType::QAsymmS8, |
| 1124 | DataType::QAsymmU8, |
| 1125 | DataType::QSymmS8, |
| 1126 | DataType::QSymmS16 |
| 1127 | }; |
| 1128 | |
| 1129 | supported &= CheckSupportRule(TypeAnyOf(input, supportedTypes), reasonIfUnsupported, |
| 1130 | "Reference Convolution3d: input is not a supported type."); |
| 1131 | |
| 1132 | supported &= CheckSupportRule(TypeAnyOf(output, supportedTypes), reasonIfUnsupported, |
| 1133 | "Reference Convolution3d: output is not a supported type."); |
| 1134 | |
| 1135 | supported &= CheckSupportRule(TypesAreEqual(input, output), reasonIfUnsupported, |
| 1136 | "Reference Convolution3d: input and output types mismatched."); |
| 1137 | |
| 1138 | const DataType inputType = input.GetDataType(); |
| 1139 | if (IsQuantized8BitType(inputType)) |
| 1140 | { |
| 1141 | std::array<DataType, 3> supportedWeightTypes = |
| 1142 | { |
| 1143 | DataType::QAsymmS8, |
| 1144 | DataType::QAsymmU8, |
| 1145 | DataType::QSymmS8 |
| 1146 | }; |
| 1147 | |
| 1148 | supported &= CheckSupportRule(TypeAnyOf(weights, supportedWeightTypes), reasonIfUnsupported, |
| 1149 | "Reference Convolution3d: weights type not supported for quantized input."); |
| 1150 | } |
| 1151 | else |
| 1152 | { |
| 1153 | supported &= CheckSupportRule(TypeAnyOf(weights, supportedTypes), reasonIfUnsupported, |
| 1154 | "Reference Convolution3d: weights is not a supported type."); |
| 1155 | |
| 1156 | supported &= CheckSupportRule(TypesAreEqual(input, weights), reasonIfUnsupported, |
| 1157 | "Reference Convolution3d: input and weights types mismatched."); |
| 1158 | } |
| 1159 | |
| 1160 | if (biases.has_value()) |
| 1161 | { |
| 1162 | std::array<DataType,4> biasesSupportedTypes = |
| 1163 | { |
| 1164 | DataType::Float32, |
| 1165 | DataType::Float16, |
| 1166 | DataType::Signed32 |
nothing calls this directly
no test coverage detected