python (12.9k questions)
javascript (9.2k questions)
reactjs (4.7k questions)
java (4.2k questions)
java (4.2k questions)
c# (3.5k questions)
c# (3.5k questions)
html (3.3k questions)
Tensorflow.js selecting specific part of Tensor
In javascript, I'm successfully converting a RGB video frame from my webcam to a tensor using TensorFlowJS's function tf.browser.fromPixels(). Now, I'd like to select only a part of this tensor accord...
EnzoBH
Votes: 0
Answers: 1
How do I shift specific elements of a tensor with torch.roll?
I have a tensor x, that looks like this:
x = tensor([ 1, 2, 3, 4, 5],
[ 6, 7, 8, 9, 10]
[ 11, 12, 13, 14, 15])
I'm trying to switch the first two and last two numbers o...
Darrel Gulseth
Votes: 0
Answers: 1
ValueError: only one element tensors can be converted to Python scalars when converting list to float Torch tensor
I have the following:
type of X is: <class 'list'>
X: [tensor([[1.3373, 0.5666, 0.2337, ..., 0.4899, 0.1876, 0.5892],
[0.0320, 0.0797, 0.0052, ..., 0.3405, 0.0000, 0.0390],
[0...

Mona Jalal
Votes: 0
Answers: 1
Error on provided shape, expected (1200000) and actual (400000) tensor values are different
Is there any way to have the input image values match the expected values? The input image I know for a fact is 800px in width, 500px in height, and is colored (meaning 3 channels), so the shape shoul...
Nic Cheng
Votes: 0
Answers: 1