Pytorch检查一个张量是否为空
检查一个pytorch的张量是不是空张量,很简单:if torch_tensor == torch.Size([]):print("this tensor is empty")else:print("this tensor is not empty")
·
检查一个pytorch的张量是不是空张量,很简单:
if torch_tensor == torch.Size([]):
print("this tensor is empty")
else:
print("this tensor is not empty")
更多推荐

所有评论(0)