EADST

Check All Values from One Tensor Equal to One Value

Check All Values from One Tensor Equal to One Value

import torch

tensor = torch.tensor([[[8, 8, 8, ..., 8, 8, 8]],
                       [[8, 8, 8, ..., 8, 8, 8]],
                       [[8, 8, 8, ..., 8, 8, 8]]], dtype=torch.int8)

is_all_eight = torch.all(tensor == 8)

print(is_all_eight)  #  True or False
相关标签
About Me
XD
Goals determine what you are going to be.
Category
标签云
站点统计

本站现有博文266篇,共被浏览440607

本站已经建立2019天!

热门文章
文章归档
回到顶部