Skip to content

Latest commit

 

History

History
41 lines (21 loc) · 843 Bytes

File metadata and controls

41 lines (21 loc) · 843 Bytes

function make_ndarray

make_ndarray(tensor_proto)

Create numpy ndarray from tensor_proto.

Args:

  • tensor_proto: TensorProto object.

Returns: Numpy ndarray with tensor proto contents.

Raises:

  • TypeError: if unsupported type is provided.

Examples:

Create TensorProto with make_tensor_proto and convert it back to numpy array with make_ndarray:

data = np.array([[1, 2, 3], [4, 5, 6]], np.int32)
tensor_proto = make_tensor_proto(data)
output = make_ndarray(tensor_proto)

Return to the main page