jina.types.ndarray package

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.


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

Get the new protobuf representation.

Return type


property value

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

Return type



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

Return type