self).__init__()self.conv=nn.Conv2d(3,3,3,1,1)defforward(self,x):print(x.shape[0])print(x.numel())x=self.conv(x)returnxmodel=DemoModel()input=torch.randn(8,3,32,32)trace=torch.jit.trace(model,input)>>>tensor(8)>>>tensor(24576)>>>tensor(8)>>>tensor(24576)>>>8>...
🐛 Describe the bug torch.linalg.matmul and torch.Tensor.matmul with torch.bfloat16 can still run without mkldnn and return incorrect results, even in PyTorch 1.13.1 (the latest released docker environment) This unexpected behavior is rel...
line 396, in backward torch.autograd.backward(self, gradient, retain_graph, create_graph, inp...
错误消息“argument 'input' (position 1) must be tensor, not torch.return_types.min”表明,在调用某个PyTorch函数时,第一个参数input应该是一个张量(tensor),但实际上传递了一个torch.return_types.min类型的对象。这种类型通常出现在使用.min()等PyTorch张量方法时,这些方法不仅返回最小值,还返回一个包含最...
pytorch/torch/csrc/autograd/python_variable.cpp Line 753 in 56dd760 "c10::string_view? dispatch_sizes_strides_policy=None, bool dispatch_device=False, bool dispatch_layout=False, " we use it to set_python_custom_sizes_strides; in this case, "sizes" gets parsed to c10::TensorImpl::...
Currently it returns a sequence of tensors of same size (https://github.com/pytorch/pytorch/blob/master/torch/_torch_docs.py#L5890) Should it not return a (stacked over dim0) tensor instead? Users will still be able to deconstruct it as: xs, ys = torch.meshgrid([torch.arange(2), ...
TensorIteratorBase::is_scalarreturnfalsefor empty numpy tensors, but true for empty Torch ones#113037 Open malfetopened this issueNov 6, 2023· 9 comments Copy link Contributor malfetcommentedNov 6, 2023• edited by pytorch-botbot 🐛 Describe the bug ...
$python a.py#`Tensor.masked_fill`: expected.dtype = torch.int64, actual.dtype = torch.float32 Expected behavior Returns the same dtype as the pytorch result. Environment PyTorch Version (e.g., 1.0): OS (e.g., Linux): How you installed PyTorch (conda,pip, source): ...
🚀 The feature, motivation and pitch Case1: Using PReLU() with a complex tensor and dtype=torch.complex64 got the simple error message as shown below: import torch my_tensor = torch.tensor([-1.+0.j, 0.+0.j, 1.+0.j]) prelu = nn.PReLU(dtype...
🐛 Describe the bug The torch.lt function without the out parameter does not return the correct shape. In the code snippet below, the forward function returns the v4_0 tensor, which has a shape of torch.Size([]). However, in torch.compile...