tensorflow-tutorial
tensorflow-tutorial copied to clipboard
tensorflow-tutorial/cpp/src/ann_model_loader.cpp
line 43, what does this line mean? what does the <float, 2> mean? what does x_map(0, j) = (*vec)[j]; mean?
auto x_map = x.tensor<float, 2>(); for (int j = 0; j < ndim; j++) { x_map(0, j) = (*vec)[j]; }
我现在想输入一张1160160 *3的图片,这里该怎么改?下面这种改法对吗? // Create New tensor and set value Tensor x(tensorflow::DT_FLOAT, tensorflow::TensorShape({1, 160, 160, 3})); // New Tensor shape [1, 160, 160, 3] auto x_map = x.tensor<float, 160 * 160 * 3>(); for (int j = 0; j < 160 * 160 * 3; j++) { x_map(0, j) = (*vec)[j]; }