python (65.1k questions)
javascript (44.2k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (12.9k questions)
How do I more efficiently convert a string of slices to slice objects that can then be used to slice arrays & tensors in PyTorch / NumPy?
How can I simplify this function that converts strings of slices for PyTorch / NumPy to slice list objects that can then be used to slice arrays & tensors?
The code below works, but it seems rathe...
ProGamerGov
Votes: 0
Answers: 2
index values not updating to what I want them to be
I have the following code. I'm trying to iterate through List2 to find all the indices of Value. I then want to set the index in List1 to 0 for all the matching indices in List2.
List1 = [1, 1, 1, 0, ...
Brandon Zabriskie
Votes: 0
Answers: 1
getting values of a torch tensor from a tensor of indices
I apologize in advance for my basics knowledge of pytorch, but this problem stuck me for some time.
Suppose I have a torch tensor u of shape (8,8,1), for example
u = tensor([[0.0000, 0.1429, 0.2857, 0...
Mara Guastini
Votes: 0
Answers: 2
How could I delete 50% of the smileys from a text, selected randomly, with Ruby?
For example:
"Hi! How :) are :) you? I'm :) fine.:)".magic()
=> "Hi! How are :) you? I'm fine.:)"
or
=> "Hi! How are :) you? I'm :) fine."
or
...
Only :) smiley sh...
Konstantin
Votes: 0
Answers: 2