I am attempting to assign values to a 2d array at particular indices.
During each iteration, all sub-arrays at the j index are being assigned the same variable (number).
inputTensor dimensions: 140x7 - 140 arrays of size 7
inputMinArray dimensions: 1x7 - 1 array of size 7
inputMaxArray dimensions: 1x7 - 1 array of size 7
var transformedInputTensor = new Array(inputTensor.length).fill(new Array(inputTensor[0].length));
for(let i = 0; i < inputTensor.length; i++){
for(let j = 0; j < inputTensor[0].length; j++ ){
number = scale(inputTensor[i][j], inputMinArray[j], inputMaxArray[j], outMin, outMax);
transformedInputTensor[i][j] = number;
}
}
The function "scale()" only outputs a single value.
Everything is functioning as expected, except the line where I assign transformedInputTensor[i][j] = number;.
Could it be that I overlooked something simple? Any suggestions would be highly appreciated. Thank you.