There was an error while loading. Please reload this page.
1 parent 1fdfc3d commit c756d17Copy full SHA for c756d17
1 file changed
src/lib.rs
@@ -316,6 +316,14 @@ impl DLPackTensor {
316
}
317
318
319
+ /// Get the ABI version of this DLPack tensor.
320
+ pub fn version(&self) -> DLPackVersion {
321
+ let tensor_ref = unsafe {
322
+ self.raw.as_ref()
323
+ };
324
+ tensor_ref.version
325
+ }
326
+
327
/// Get a pointer to data in this tensor. This pointer can be a device
328
/// pointer according to [`DLPackTensor::device`].
329
pub fn data_ptr<T>(&self) -> Result<*const T, CastError> where T: DLPackPointerCast {
0 commit comments