8 float tensor[2][3][4] = {0};
9 const float* tensor1 = (
float*) tensor;
11 std::vector<size_t> shape={2,3,4};
20 assert(msg.
payload().size() == 2);
24 std::cout << lobj << std::endl;
27 for (
int ind=0; ind < 3; ++ind) {
28 assert(shape[ind] == md[
"shape"][ind].get<size_t>());
31 const float* tensor2 = zio::tens::at<float>(msg, 0);
33 for (
size_t ind=0; ind<24; ++ind) {
34 std::cout<<ind<<
" " << tensor1[ind] <<
" " << tensor2[ind] << std::endl;
35 assert(tensor1[ind] == tensor2[ind]);
40 assert(!spmp.
empty());
const zio::message_t & at(const Message &msg, size_t index)
ZMQ_NODISCARD bool empty() const ZMQ_NOTHROW
zio::json label_object() const
Helper, when label holds a JSON object.
void add(message_t &&spmsg)
const multipart_t & payload() const
Access payload(s)
void append(Message &msg, message_t &&data, const std::vector< size_t > &shape, size_t word_size, const char *tn)
size_t size() const ZMQ_NOTHROW