Struct caffe2_serde::TensorDeserializer
source · pub struct TensorDeserializer {}
Expand description
| @brief | | TensorDeserializer is the deserializer | for Tensors. | | The device that the deserialized Tensor | will live under is determined by the | device_detail field. If you want to | specify the device of the deserialized | tensor, change the TensorProto’s corresponding | fields before calling | | Deserialize. |
Implementations§
source§impl TensorDeserializer
impl TensorDeserializer
sourcepub fn deserialize_to_tensor(
&mut self,
tensor_proto: &TensorProto,
tensor: *mut Tensor
)
pub fn deserialize_to_tensor( &mut self, tensor_proto: &TensorProto, tensor: *mut Tensor )
| There are cases when a Tensor is split | into multiple protos and we have to call | Deserialize multiple times to get the | complete deserialized | | Tensor, each call will fill part of the | Tensor given the segment begin and end | information in proto, therefore we | have to pass in the Tensor pointer rather | than create a new Tensor every time. | | Precondition: Tensor must be initialized |
sourcepub fn deserialize_from_tensor_proto(
&mut self,
tensor_proto: &TensorProto
) -> Tensor
pub fn deserialize_from_tensor_proto( &mut self, tensor_proto: &TensorProto ) -> Tensor
| Deserialize the proto and return a new | Tensor | | This is a utility function that combines | EmptyTensorFromProto and | | Deserialize(const TensorProto&, | Tensor*); |
Trait Implementations§
source§impl BlobDeserializerBase for TensorDeserializer
impl BlobDeserializerBase for TensorDeserializer
source§fn deserialize(&mut self, blob_proto: &BlobProto, blob: *mut Blob)
fn deserialize(&mut self, blob_proto: &BlobProto, blob: *mut Blob)
Auto Trait Implementations§
impl RefUnwindSafe for TensorDeserializer
impl Send for TensorDeserializer
impl Sync for TensorDeserializer
impl Unpin for TensorDeserializer
impl UnwindSafe for TensorDeserializer
Blanket Implementations§
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.