#### Category : tensor

I’m looking to make a loss function that can take 2 tensors of any dimensions as parameters, but the dimensions of tensor 1 (t1) and tensor (t2) must match. Below are the templates that I tried to use to can pass the tensors into the function. I was thinking that T would be a type ..

I need to implement an arbitrary rank tensor (the number of dimensions is entered by the user). How do I iterate if I don’t know the rank of the tensor in advance? For example, to implement tensor transposition, only nested "for" loops come to mind, but this cannot be done without knowing the number of ..

Suppose, I have a file with value 0 0 1 0 1 0 0 2 2 1 0 0 1 1 0 1 2 3 2 0 0 2 1 0 2 2 4 Now I want to search matrix index from this file for(int a=0; a<8;a=a+2){ for(int b=0; b<8;b=b+2){ for(int c=a; c<2;c++){ for(int d=a; ..

I am trying to work through this question and I have no idea what is being asked. I’m not asking for a solution as I’m solving this to learn. I am asking for a simpler explanation of the problem. Write a function: vector<int> solution(vector<int> &P, vector<int> &Q); that given a zero-indexed, tensor P which is ..

I am calling a torchscript (neural network serialized from Python) from a C++ program: // define inputs int batch = 3; // batch size int n_inp = 2; // number of inputs double I[batch][n_inp] = {{1.0, 1.0}, {2.0, 3.0}, {4.0, 5.0}}; // some random input std::cout << "inputs" "n"; // print inputs for (int i ..

I am trying to implement yolov3 tiny on the edge device with tensorflow lite to detect two types of object. I trained my model on darknet first and convert the .cfg file and .weights to Keras .h5 format with this repository. And do the post training quantization and converted it to .tflite format. However, I ..

I am using Essentia with C++ but in the include statement both algorithmfactory and credit_libav.h throw me an error: #include<iostream> #include<fstream> #include<essentia/algorithmfactory.h> … #include "credit_libav.h" it says can’t open source file "unsupported/Eigen/CXX11/tensor" (dependency of essentia/algorithmfactory.h) for the 3rd line and can’t open source file for credit_libav.h Where did I go wrong please ? I don’t ..