jina.types.ndarray

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

Bases: object

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()

property null_proto

Get the new protobuf representation

Return type

GeneratedProtocolMessageType

property value

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