diff --git a/src/value/mod.rs b/src/value/mod.rs
index 2ee91b39..c51c2810 100644
--- a/src/value/mod.rs
+++ b/src/value/mod.rs
@@ -87,7 +87,9 @@ pub enum ValueType {
 		key: TensorElementType,
 		/// The map value type.
 		value: TensorElementType
-	}
+	},
+	/// An optional value, which may or may not contain a [`Value`].
+	Optional(Box<ValueType>)
 }
 
 impl ValueType {
@@ -110,6 +112,15 @@ impl ValueType {
 				ortsys![unsafe CastTypeInfoToMapTypeInfo(typeinfo_ptr, &mut info_ptr)?; nonNull(info_ptr)];
 				unsafe { extract_data_type_from_map_info(info_ptr)? }
 			}
+			ort_sys::ONNXType::ONNX_TYPE_OPTIONAL => {
+				let mut info_ptr: *const ort_sys::OrtOptionalTypeInfo = std::ptr::null_mut();
+				ortsys![unsafe CastTypeInfoToOptionalTypeInfo(typeinfo_ptr, &mut info_ptr)?; nonNull(info_ptr)];
+
+				let mut contained_type: *mut ort_sys::OrtTypeInfo = std::ptr::null_mut();
+				ortsys![unsafe GetOptionalContainedTypeInfo(info_ptr, &mut contained_type)?; nonNull(contained_type)];
+
+				ValueType::Optional(Box::new(ValueType::from_type_info(contained_type)?))
+			}
 			_ => unreachable!()
 		};
 		ortsys![unsafe ReleaseTypeInfo(typeinfo_ptr)];