jina.types.ndarray package

Subpackages

Submodules

Module contents

class jina.types.ndarray.BaseNdArray(proto=None, *args, **kwargs)[source]

Bases: jina.types.mixin.ProtoTypeMixin

A base class for containing the protobuf message of NdArray. It defines interfaces for easier get/set value.

Do not use this class directly. Subclass should be used.

Parameters

proto (Union[GeneratedProtocolMessageType, ~AnyNdArray, None]) – the protobuf message, when not given then create a new one via get_null_proto()

Set the constructor method.

property null_proto: google.protobuf.pyext.cpp_message.GeneratedProtocolMessageType

Get the new protobuf representation.

Return type

GeneratedProtocolMessageType

property value: jina.types.ndarray.AnyNdArray

Return the value of the ndarray, in numpy, scipy, tensorflow, pytorch type.

Return type

~AnyNdArray

copy_to(proto)[source]

Copy itself to another protobuf message, return a view of the copied message.

Return type

BaseNdArray