in 04_EdgeApplication/turbine/edgeagentclient.py [0:0]
def create_tensor(self, x, tensor_name):
if (x.dtype != np.float32):
raise Exception( "It only supports numpy float32 arrays for this tensor" )
tensor = agent.Tensor()
tensor.tensor_metadata.name = tensor_name
tensor.tensor_metadata.data_type = agent.FLOAT32
for s in x.shape: tensor.tensor_metadata.shape.append(s)
tensor.byte_data = x.tobytes()
return tensor