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)
Is this the right way to compute cosine similarity in PyTroch?
cos = torch.nn.CosineSimilarity(dim=-1, eps=1e-6)
c = torch.FloatTensor([1, 2, 4])
b = torch.FloatTensor([1, 2, 3])
simi = cos(b,c)
tensor(0.9915)
I am using dim=-1 in this funciton, does that mean i...

marlon
Votes: 0
Answers: 1
How to set value at Tensor index in batch
I have a tensor of batch size N.
t = [[...], [....], [....] .... ]
In second tensor indices, I have N indices of elements I want to change in each tensor
indices = [i0, i1, i2 .... ]
So I want to ha...

Martin Perry
Votes: 0
Answers: 1
How to covert Fastspeech2 to Onnx with dynamic input and output?
How Can I get dynamic input in torch model to onnx model ?
I give input with dynamic_axes, but the output in inference is not dynamic.
My code:
input_names = ['speakers', 'texts', 'src_lens', 'max...

Frank.Fan
Votes: 0
Answers: 0
Torchserve fails to load model on docker while it runs locally
I have a torchscript model (.pt) that I can successfully load and serve with torch serve on my local machine. On the other side, when trying to deploy it in the oficial torchserve docker it will compl...
eljiwo
Votes: 0
Answers: 1