Closed xiabingquan closed 8 months ago
Hi @xiabingquan, the bug has been fixed. Thank you!
def cut_or_pad(data, size, dim=0): if data.size(dim) < size: padding = size - data.size(dim) data = torch.nn.functional.pad(data, (0, 0, 0, padding), "constant") # modified size = data.size(dim) # added elif data.size(dim) > size: data = data[:size] assert data.size(dim) == size return data
Does this problem affect the accuracy?
def cut_or_pad(data, size, dim=0): if data.size(dim) < size: padding = size - data.size(dim) data = torch.nn.functional.pad(data, (0, 0, 0, padding), "constant") # modified size = data.size(dim) # added elif data.size(dim) > size: data = data[:size] assert data.size(dim) == size return data
Does this problem affect the accuracy?
In my case, it raises errors if not modified.
def cut_or_pad(data, size, dim=0): if data.size(dim) < size: padding = size - data.size(dim) data = torch.nn.functional.pad(data, (0, 0, 0, padding), "constant") # modified size = data.size(dim) # added elif data.size(dim) > size: data = data[:size] assert data.size(dim) == size return data
Does this problem affect the accuracy?
In my case, it raises errors if not modified.
What kind of error is the error you mentioned? Is it an error that the code itself does not execute?
The current version is:
The right version should be: