torch.BoolTensor
时间: 2023-12-02 11:15:33 浏览: 115
PyTorch的torch.cat用法
5星 · 资源好评率100%
torch.BoolTensor is a tensor that consists of elements of the boolean data type. Each element in the tensor can either be True or False. This tensor is useful for performing logical operations, such as AND, OR, and NOT, on binary data. It is a subclass of the torch.Tensor class and inherits all of its methods and attributes. The main difference between BoolTensor and other tensor types is that it only requires one bit to represent each element, rather than 8 bits (1 byte) for each element in a ByteTensor or 32 bits (4 bytes) for each element in a FloatTensor. This makes BoolTensor more memory-efficient for storing large arrays of binary data.
阅读全文