This repository has been archived by the owner on Jan 10, 2023. It is now read-only.
Bridge Python numpy.ndarray
to Array
and Tensor
#30
Labels
numpy.ndarray
to Array
and Tensor
#30
From mailing list discussion: https://groups.google.com/a/tensorflow.org/forum/#!topic/swift/0de3S72qMTU
It would be nice to add initializers that bridge Python
numpy.ndarray
(asPyValue
) to SwiftArray
andTensor
.The implementation should use the raw NumPy data pointer via
arr.__array_interface__["data"]
for efficiency:Here is a sample skeleton for a
Tensor
bridge:Something to consider is how to handle bridging higher dimensional
numpy.ndarray
instances toArray
. It makes sense for the bridging initializer to fail when thenumpy.ndarray
instance is not 1-D.The text was updated successfully, but these errors were encountered: