torch.Storage¶
A torch.Storage 是一个连续的、一维的单一数据类型的数组。
每个 torch.Tensor 都有一个对应相同数据类型的存储。
-
class
torch.DoubleStorage(*args, **kwargs)[source]¶ -
bfloat16()¶ 将此存储转换为 bfloat16 类型
-
bool()¶ 将此存储转换为布尔类型
-
byte()¶ 将此存储转换为字节类型
-
char()¶ 将此存储转换为字符类型
-
clone()¶ 返回此存储的副本
-
complex_double()¶ 将此存储转换为复数双精度类型
-
complex_float()¶ 将此存储转换为复数浮点类型
-
copy_(source, non_blocking=None)¶
-
cpu()¶ 如果此存储不在 CPU 上,则返回其在 CPU 上的副本。
-
cuda(device=None, non_blocking=False, **kwargs)¶
-
data_ptr()¶
-
property
device¶
-
double()¶ 将此存储转换为双精度类型
-
element_size()¶
-
fill_(value)¶
-
float()¶ 将此存储转换为浮点类型
-
classmethod
from_buffer(*args, **kwargs)¶
-
classmethod
from_file(filename, shared, size)¶
-
get_device()¶
-
half()¶ 将此存储转换为半精度类型
-
int()¶ 将此存储转换为 int 类型
-
property
is_cuda¶
-
is_pinned()¶
-
is_sparse= False¶
-
long()¶ 将此存储转换为长整型
-
nbytes()¶
-
pickle_storage_type()¶
-
pin_memory()¶ 如果存储尚未固定,则将其复制到固定内存中。
-
resize_(size)¶
将存储移动到共享内存。
对于已经位于共享内存中的存储以及不需要跨进程共享的 CUDA 存储,此操作不会产生任何效果。共享内存中的存储无法调整大小。
返回值: self
-
short()¶ 将此存储转换为 short 类型
-
size()¶
-
tolist()¶ 返回一个包含此存储元素的列表
-
type(dtype=None, non_blocking=False)¶
-
-
class
torch.FloatStorage(*args, **kwargs)[source]¶ -
bfloat16()¶ 将此存储转换为 bfloat16 类型
-
bool()¶ 将此存储转换为布尔类型
-
byte()¶ 将此存储转换为字节类型
-
char()¶ 将此存储转换为字符类型
-
clone()¶ 返回此存储的副本
-
complex_double()¶ 将此存储转换为复数双精度类型
-
complex_float()¶ 将此存储转换为复数浮点类型
-
copy_(source, non_blocking=None)¶
-
cpu()¶ 如果此存储不在 CPU 上,则返回其在 CPU 上的副本。
-
cuda(device=None, non_blocking=False, **kwargs)¶
-
data_ptr()¶
-
property
device¶
-
double()¶ 将此存储转换为双精度类型
-
element_size()¶
-
fill_(value)¶
-
float()¶ 将此存储转换为浮点类型
-
classmethod
from_buffer(*args, **kwargs)¶
-
classmethod
from_file(filename, shared, size)¶
-
get_device()¶
-
half()¶ 将此存储转换为半精度类型
-
int()¶ 将此存储转换为 int 类型
-
property
is_cuda¶
-
is_pinned()¶
-
is_sparse= False¶
-
long()¶ 将此存储转换为长整型
-
nbytes()¶
-
pickle_storage_type()¶
-
pin_memory()¶ 如果存储尚未固定,则将其复制到固定内存中。
-
resize_(size)¶
将存储移动到共享内存。
对于已经位于共享内存中的存储以及不需要跨进程共享的 CUDA 存储,此操作不会产生任何效果。共享内存中的存储无法调整大小。
返回值: self
-
short()¶ 将此存储转换为 short 类型
-
size()¶
-
tolist()¶ 返回一个包含此存储元素的列表
-
type(dtype=None, non_blocking=False)¶
-
-
class
torch.HalfStorage(*args, **kwargs)[source]¶ -
bfloat16()¶ 将此存储转换为 bfloat16 类型
-
bool()¶ 将此存储转换为布尔类型
-
byte()¶ 将此存储转换为字节类型
-
char()¶ 将此存储转换为字符类型
-
clone()¶ 返回此存储的副本
-
complex_double()¶ 将此存储转换为复数双精度类型
-
complex_float()¶ 将此存储转换为复数浮点类型
-
copy_(source, non_blocking=None)¶
-
cpu()¶ 如果此存储不在 CPU 上,则返回其在 CPU 上的副本。
-
cuda(device=None, non_blocking=False, **kwargs)¶
-
data_ptr()¶
-
property
device¶
-
double()¶ 将此存储转换为双精度类型
-
element_size()¶
-
fill_(value)¶
-
float()¶ 将此存储转换为浮点类型
-
classmethod
from_buffer(*args, **kwargs)¶
-
classmethod
from_file(filename, shared, size)¶
-
get_device()¶
-
half()¶ 将此存储转换为半精度类型
-
int()¶ 将此存储转换为 int 类型
-
property
is_cuda¶
-
is_pinned()¶
-
is_sparse= False¶
-
long()¶ 将此存储转换为长整型
-
nbytes()¶
-
pickle_storage_type()¶
-
pin_memory()¶ 如果存储尚未固定,则将其复制到固定内存中。
-
resize_(size)¶
将存储移动到共享内存。
对于已经位于共享内存中的存储以及不需要跨进程共享的 CUDA 存储,此操作不会产生任何效果。共享内存中的存储无法调整大小。
返回值: self
-
short()¶ 将此存储转换为 short 类型
-
size()¶
-
tolist()¶ 返回一个包含此存储元素的列表
-
type(dtype=None, non_blocking=False)¶
-
-
class
torch.LongStorage(*args, **kwargs)[source]¶ -
bfloat16()¶ 将此存储转换为 bfloat16 类型
-
bool()¶ 将此存储转换为布尔类型
-
byte()¶ 将此存储转换为字节类型
-
char()¶ 将此存储转换为字符类型
-
clone()¶ 返回此存储的副本
-
complex_double()¶ 将此存储转换为复数双精度类型
-
complex_float()¶ 将此存储转换为复数浮点类型
-
copy_(source, non_blocking=None)¶
-
cpu()¶ 如果此存储不在 CPU 上,则返回其在 CPU 上的副本。
-
cuda(device=None, non_blocking=False, **kwargs)¶
-
data_ptr()¶
-
property
device¶
-
double()¶ 将此存储转换为双精度类型
-
element_size()¶
-
fill_(value)¶
-
float()¶ 将此存储转换为浮点类型
-
classmethod
from_buffer(*args, **kwargs)¶
-
classmethod
from_file(filename, shared, size)¶
-
get_device()¶
-
half()¶ 将此存储转换为半精度类型
-
int()¶ 将此存储转换为 int 类型
-
property
is_cuda¶
-
is_pinned()¶
-
is_sparse= False¶
-
long()¶ 将此存储转换为长整型
-
nbytes()¶
-
pickle_storage_type()¶
-
pin_memory()¶ 如果存储尚未固定,则将其复制到固定内存中。
-
resize_(size)¶
将存储移动到共享内存。
对于已经位于共享内存中的存储以及不需要跨进程共享的 CUDA 存储,此操作不会产生任何效果。共享内存中的存储无法调整大小。
返回值: self
-
short()¶ 将此存储转换为 short 类型
-
size()¶
-
tolist()¶ 返回一个包含此存储元素的列表
-
type(dtype=None, non_blocking=False)¶
-
-
class
torch.IntStorage(*args, **kwargs)[source]¶ -
bfloat16()¶ 将此存储转换为 bfloat16 类型
-
bool()¶ 将此存储转换为布尔类型
-
byte()¶ 将此存储转换为字节类型
-
char()¶ 将此存储转换为字符类型
-
clone()¶ 返回此存储的副本
-
complex_double()¶ 将此存储转换为复数双精度类型
-
complex_float()¶ 将此存储转换为复数浮点类型
-
copy_(source, non_blocking=None)¶
-
cpu()¶ 如果此存储不在 CPU 上,则返回其在 CPU 上的副本。
-
cuda(device=None, non_blocking=False, **kwargs)¶
-
data_ptr()¶
-
property
device¶
-
double()¶ 将此存储转换为双精度类型
-
element_size()¶
-
fill_(value)¶
-
float()¶ 将此存储转换为浮点类型
-
classmethod
from_buffer(*args, **kwargs)¶
-
classmethod
from_file(filename, shared, size)¶
-
get_device()¶
-
half()¶ 将此存储转换为半精度类型
-
int()¶ 将此存储转换为 int 类型
-
property
is_cuda¶
-
is_pinned()¶
-
is_sparse= False¶
-
long()¶ 将此存储转换为长整型
-
nbytes()¶
-
pickle_storage_type()¶
-
pin_memory()¶ 如果存储尚未固定,则将其复制到固定内存中。
-
resize_(size)¶
将存储移动到共享内存。
对于已经位于共享内存中的存储以及不需要跨进程共享的 CUDA 存储,此操作不会产生任何效果。共享内存中的存储无法调整大小。
返回值: self
-
short()¶ 将此存储转换为 short 类型
-
size()¶
-
tolist()¶ 返回一个包含此存储元素的列表
-
type(dtype=None, non_blocking=False)¶
-
-
class
torch.ShortStorage(*args, **kwargs)[source]¶ -
bfloat16()¶ 将此存储转换为 bfloat16 类型
-
bool()¶ 将此存储转换为布尔类型
-
byte()¶ 将此存储转换为字节类型
-
char()¶ 将此存储转换为字符类型
-
clone()¶ 返回此存储的副本
-
complex_double()¶ 将此存储转换为复数双精度类型
-
complex_float()¶ 将此存储转换为复数浮点类型
-
copy_(source, non_blocking=None)¶
-
cpu()¶ 如果此存储不在 CPU 上,则返回其在 CPU 上的副本。
-
cuda(device=None, non_blocking=False, **kwargs)¶
-
data_ptr()¶
-
property
device¶
-
double()¶ 将此存储转换为双精度类型
-
element_size()¶
-
fill_(value)¶
-
float()¶ 将此存储转换为浮点类型
-
classmethod
from_buffer(*args, **kwargs)¶
-
classmethod
from_file(filename, shared, size)¶
-
get_device()¶
-
half()¶ 将此存储转换为半精度类型
-
int()¶ 将此存储转换为 int 类型
-
property
is_cuda¶
-
is_pinned()¶
-
is_sparse= False¶
-
long()¶ 将此存储转换为长整型
-
nbytes()¶
-
pickle_storage_type()¶
-
pin_memory()¶ 如果存储尚未固定,则将其复制到固定内存中。
-
resize_(size)¶
将存储移动到共享内存。
对于已经位于共享内存中的存储以及不需要跨进程共享的 CUDA 存储,此操作不会产生任何效果。共享内存中的存储无法调整大小。
返回值: self
-
short()¶ 将此存储转换为 short 类型
-
size()¶
-
tolist()¶ 返回一个包含此存储元素的列表
-
type(dtype=None, non_blocking=False)¶
-
-
class
torch.CharStorage(*args, **kwargs)[source]¶ -
bfloat16()¶ 将此存储转换为 bfloat16 类型
-
bool()¶ 将此存储转换为布尔类型
-
byte()¶ 将此存储转换为字节类型
-
char()¶ 将此存储转换为字符类型
-
clone()¶ 返回此存储的副本
-
complex_double()¶ 将此存储转换为复数双精度类型
-
complex_float()¶ 将此存储转换为复数浮点类型
-
copy_(source, non_blocking=None)¶
-
cpu()¶ 如果此存储不在 CPU 上,则返回其在 CPU 上的副本。
-
cuda(device=None, non_blocking=False, **kwargs)¶
-
data_ptr()¶
-
property
device¶
-
double()¶ 将此存储转换为双精度类型
-
element_size()¶
-
fill_(value)¶
-
float()¶ 将此存储转换为浮点类型
-
classmethod
from_buffer(*args, **kwargs)¶
-
classmethod
from_file(filename, shared, size)¶
-
get_device()¶
-
half()¶ 将此存储转换为半精度类型
-
int()¶ 将此存储转换为 int 类型
-
property
is_cuda¶
-
is_pinned()¶
-
is_sparse= False¶
-
long()¶ 将此存储转换为长整型
-
nbytes()¶
-
pickle_storage_type()¶
-
pin_memory()¶ 如果存储尚未固定,则将其复制到固定内存中。
-
resize_(size)¶
将存储移动到共享内存。
对于已经位于共享内存中的存储以及不需要跨进程共享的 CUDA 存储,此操作不会产生任何效果。共享内存中的存储无法调整大小。
返回值: self
-
short()¶ 将此存储转换为 short 类型
-
size()¶
-
tolist()¶ 返回一个包含此存储元素的列表
-
type(dtype=None, non_blocking=False)¶
-
-
class
torch.ByteStorage(*args, **kwargs)[source]¶ -
bfloat16()¶ 将此存储转换为 bfloat16 类型
-
bool()¶ 将此存储转换为布尔类型
-
byte()¶ 将此存储转换为字节类型
-
char()¶ 将此存储转换为字符类型
-
clone()¶ 返回此存储的副本
-
complex_double()¶ 将此存储转换为复数双精度类型
-
complex_float()¶ 将此存储转换为复数浮点类型
-
copy_(source, non_blocking=None)¶
-
cpu()¶ 如果此存储不在 CPU 上,则返回其在 CPU 上的副本。
-
cuda(device=None, non_blocking=False, **kwargs)¶
-
data_ptr()¶
-
property
device¶
-
double()¶ 将此存储转换为双精度类型
-
element_size()¶
-
fill_(value)¶
-
float()¶ 将此存储转换为浮点类型
-
classmethod
from_buffer(*args, **kwargs)¶
-
classmethod
from_file(filename, shared, size)¶
-
get_device()¶
-
half()¶ 将此存储转换为半精度类型
-
int()¶ 将此存储转换为 int 类型
-
property
is_cuda¶
-
is_pinned()¶
-
is_sparse= False¶
-
long()¶ 将此存储转换为长整型
-
nbytes()¶
-
pickle_storage_type()¶
-
pin_memory()¶ 如果存储尚未固定,则将其复制到固定内存中。
-
resize_(size)¶
将存储移动到共享内存。
对于已经位于共享内存中的存储以及不需要跨进程共享的 CUDA 存储,此操作不会产生任何效果。共享内存中的存储无法调整大小。
返回值: self
-
short()¶ 将此存储转换为 short 类型
-
size()¶
-
tolist()¶ 返回一个包含此存储元素的列表
-
type(dtype=None, non_blocking=False)¶
-
-
class
torch.BoolStorage(*args, **kwargs)[source]¶ -
bfloat16()¶ 将此存储转换为 bfloat16 类型
-
bool()¶ 将此存储转换为布尔类型
-
byte()¶ 将此存储转换为字节类型
-
char()¶ 将此存储转换为字符类型
-
clone()¶ 返回此存储的副本
-
complex_double()¶ 将此存储转换为复数双精度类型
-
complex_float()¶ 将此存储转换为复数浮点类型
-
copy_(source, non_blocking=None)¶
-
cpu()¶ 如果此存储不在 CPU 上,则返回其在 CPU 上的副本。
-
cuda(device=None, non_blocking=False, **kwargs)¶
-
data_ptr()¶
-
property
device¶
-
double()¶ 将此存储转换为双精度类型
-
element_size()¶
-
fill_(value)¶
-
float()¶ 将此存储转换为浮点类型
-
classmethod
from_buffer(*args, **kwargs)¶
-
classmethod
from_file(filename, shared, size)¶
-
get_device()¶
-
half()¶ 将此存储转换为半精度类型
-
int()¶ 将此存储转换为 int 类型
-
property
is_cuda¶
-
is_pinned()¶
-
is_sparse= False¶
-
long()¶ 将此存储转换为长整型
-
nbytes()¶
-
pickle_storage_type()¶
-
pin_memory()¶ 如果存储尚未固定,则将其复制到固定内存中。
-
resize_(size)¶
将存储移动到共享内存。
对于已经位于共享内存中的存储以及不需要跨进程共享的 CUDA 存储,此操作不会产生任何效果。共享内存中的存储无法调整大小。
返回值: self
-
short()¶ 将此存储转换为 short 类型
-
size()¶
-
tolist()¶ 返回一个包含此存储元素的列表
-
type(dtype=None, non_blocking=False)¶
-
-
class
torch.BFloat16Storage(*args, **kwargs)[source]¶ -
bfloat16()¶ 将此存储转换为 bfloat16 类型
-
bool()¶ 将此存储转换为布尔类型
-
byte()¶ 将此存储转换为字节类型
-
char()¶ 将此存储转换为字符类型
-
clone()¶ 返回此存储的副本
-
complex_double()¶ 将此存储转换为复数双精度类型
-
complex_float()¶ 将此存储转换为复数浮点类型
-
copy_(source, non_blocking=None)¶
-
cpu()¶ 如果此存储不在 CPU 上,则返回其在 CPU 上的副本。
-
cuda(device=None, non_blocking=False, **kwargs)¶
-
data_ptr()¶
-
property
device¶
-
double()¶ 将此存储转换为双精度类型
-
element_size()¶
-
fill_(value)¶
-
float()¶ 将此存储转换为浮点类型
-
classmethod
from_buffer(*args, **kwargs)¶
-
classmethod
from_file(filename, shared, size)¶
-
get_device()¶
-
half()¶ 将此存储转换为半精度类型
-
int()¶ 将此存储转换为 int 类型
-
property
is_cuda¶
-
is_pinned()¶
-
is_sparse= False¶
-
long()¶ 将此存储转换为长整型
-
nbytes()¶
-
pickle_storage_type()¶
-
pin_memory()¶ 如果存储尚未固定,则将其复制到固定内存中。
-
resize_(size)¶
将存储移动到共享内存。
对于已经位于共享内存中的存储以及不需要跨进程共享的 CUDA 存储,此操作不会产生任何效果。共享内存中的存储无法调整大小。
返回值: self
-
short()¶ 将此存储转换为 short 类型
-
size()¶
-
tolist()¶ 返回一个包含此存储元素的列表
-
type(dtype=None, non_blocking=False)¶
-
-
class
torch.ComplexDoubleStorage(*args, **kwargs)[source]¶ -
bfloat16()¶ 将此存储转换为 bfloat16 类型
-
bool()¶ 将此存储转换为布尔类型
-
byte()¶ 将此存储转换为字节类型
-
char()¶ 将此存储转换为字符类型
-
clone()¶ 返回此存储的副本
-
complex_double()¶ 将此存储转换为复数双精度类型
-
complex_float()¶ 将此存储转换为复数浮点类型
-
copy_(source, non_blocking=None)¶
-
cpu()¶ 如果此存储不在 CPU 上,则返回其在 CPU 上的副本。
-
cuda(device=None, non_blocking=False, **kwargs)¶
-
data_ptr()¶
-
property
device¶
-
double()¶ 将此存储转换为双精度类型
-
element_size()¶
-
fill_(value)¶
-
float()¶ 将此存储转换为浮点类型
-
classmethod
from_buffer(*args, **kwargs)¶
-
classmethod
from_file(filename, shared, size)¶
-
get_device()¶
-
half()¶ 将此存储转换为半精度类型
-
int()¶ 将此存储转换为 int 类型
-
property
is_cuda¶
-
is_pinned()¶
-
is_sparse= False¶
-
long()¶ 将此存储转换为长整型
-
nbytes()¶
-
pickle_storage_type()¶
-
pin_memory()¶ 如果存储尚未固定,则将其复制到固定内存中。
-
resize_(size)¶
将存储移动到共享内存。
对于已经位于共享内存中的存储以及不需要跨进程共享的 CUDA 存储,此操作不会产生任何效果。共享内存中的存储无法调整大小。
返回值: self
-
short()¶ 将此存储转换为 short 类型
-
size()¶
-
tolist()¶ 返回一个包含此存储元素的列表
-
type(dtype=None, non_blocking=False)¶
-
-
class
torch.ComplexFloatStorage(*args, **kwargs)[source]¶ -
bfloat16()¶ 将此存储转换为 bfloat16 类型
-
bool()¶ 将此存储转换为布尔类型
-
byte()¶ 将此存储转换为字节类型
-
char()¶ 将此存储转换为字符类型
-
clone()¶ 返回此存储的副本
-
complex_double()¶ 将此存储转换为复数双精度类型
-
complex_float()¶ 将此存储转换为复数浮点类型
-
copy_(source, non_blocking=None)¶
-
cpu()¶ 如果此存储不在 CPU 上,则返回其在 CPU 上的副本。
-
cuda(device=None, non_blocking=False, **kwargs)¶
-
data_ptr()¶
-
property
device¶
-
double()¶ 将此存储转换为双精度类型
-
element_size()¶
-
fill_(value)¶
-
float()¶ 将此存储转换为浮点类型
-
classmethod
from_buffer(*args, **kwargs)¶
-
classmethod
from_file(filename, shared, size)¶
-
get_device()¶
-
half()¶ 将此存储转换为半精度类型
-
int()¶ 将此存储转换为 int 类型
-
property
is_cuda¶
-
is_pinned()¶
-
is_sparse= False¶
-
long()¶ 将此存储转换为长整型
-
nbytes()¶
-
pickle_storage_type()¶
-
pin_memory()¶ 如果存储尚未固定,则将其复制到固定内存中。
-
resize_(size)¶
将存储移动到共享内存。
对于已经位于共享内存中的存储以及不需要跨进程共享的 CUDA 存储,此操作不会产生任何效果。共享内存中的存储无法调整大小。
返回值: self
-
short()¶ 将此存储转换为 short 类型
-
size()¶
-
tolist()¶ 返回一个包含此存储元素的列表
-
type(dtype=None, non_blocking=False)¶
-
-
class
torch.QUInt8Storage(*args, **kwargs)[source]¶ -
bfloat16()¶ 将此存储转换为 bfloat16 类型
-
bool()¶ 将此存储转换为布尔类型
-
byte()¶ 将此存储转换为字节类型
-
char()¶ 将此存储转换为字符类型
-
clone()¶ 返回此存储的副本
-
complex_double()¶ 将此存储转换为复数双精度类型
-
complex_float()¶ 将此存储转换为复数浮点类型
-
copy_(source, non_blocking=None)¶
-
cpu()¶ 如果此存储不在 CPU 上,则返回其在 CPU 上的副本。
-
cuda(device=None, non_blocking=False, **kwargs)¶
-
data_ptr()¶
-
property
device¶
-
double()¶ 将此存储转换为双精度类型
-
element_size()¶
-
fill_(value)¶
-
float()¶ 将此存储转换为浮点类型
-
classmethod
from_buffer(*args, **kwargs)¶
-
classmethod
from_file(filename, shared, size)¶
-
get_device()¶
-
half()¶ 将此存储转换为半精度类型
-
int()¶ 将此存储转换为 int 类型
-
property
is_cuda¶
-
is_pinned()¶
-
is_sparse= False¶
-
long()¶ 将此存储转换为长整型
-
nbytes()¶
-
pickle_storage_type()¶
-
pin_memory()¶ 如果存储尚未固定,则将其复制到固定内存中。
-
resize_(size)¶
将存储移动到共享内存。
对于已经位于共享内存中的存储以及不需要跨进程共享的 CUDA 存储,此操作不会产生任何效果。共享内存中的存储无法调整大小。
返回值: self
-
short()¶ 将此存储转换为 short 类型
-
size()¶
-
tolist()¶ 返回一个包含此存储元素的列表
-
type(dtype=None, non_blocking=False)¶
-
-
class
torch.QInt8Storage(*args, **kwargs)[source]¶ -
bfloat16()¶ 将此存储转换为 bfloat16 类型
-
bool()¶ 将此存储转换为布尔类型
-
byte()¶ 将此存储转换为字节类型
-
char()¶ 将此存储转换为字符类型
-
clone()¶ 返回此存储的副本
-
complex_double()¶ 将此存储转换为复数双精度类型
-
complex_float()¶ 将此存储转换为复数浮点类型
-
copy_(source, non_blocking=None)¶
-
cpu()¶ 如果此存储不在 CPU 上,则返回其在 CPU 上的副本。
-
cuda(device=None, non_blocking=False, **kwargs)¶
-
data_ptr()¶
-
property
device¶
-
double()¶ 将此存储转换为双精度类型
-
element_size()¶
-
fill_(value)¶
-
float()¶ 将此存储转换为浮点类型
-
classmethod
from_buffer(*args, **kwargs)¶
-
classmethod
from_file(filename, shared, size)¶
-
get_device()¶
-
half()¶ 将此存储转换为半精度类型
-
int()¶ 将此存储转换为 int 类型
-
property
is_cuda¶
-
is_pinned()¶
-
is_sparse= False¶
-
long()¶ 将此存储转换为长整型
-
nbytes()¶
-
pickle_storage_type()¶
-
pin_memory()¶ 如果存储尚未固定,则将其复制到固定内存中。
-
resize_(size)¶
将存储移动到共享内存。
对于已经位于共享内存中的存储以及不需要跨进程共享的 CUDA 存储,此操作不会产生任何效果。共享内存中的存储无法调整大小。
返回值: self
-
short()¶ 将此存储转换为 short 类型
-
size()¶
-
tolist()¶ 返回一个包含此存储元素的列表
-
type(dtype=None, non_blocking=False)¶
-
-
class
torch.QInt32Storage(*args, **kwargs)[source]¶ -
bfloat16()¶ 将此存储转换为 bfloat16 类型
-
bool()¶ 将此存储转换为布尔类型
-
byte()¶ 将此存储转换为字节类型
-
char()¶ 将此存储转换为字符类型
-
clone()¶ 返回此存储的副本
-
complex_double()¶ 将此存储转换为复数双精度类型
-
complex_float()¶ 将此存储转换为复数浮点类型
-
copy_(source, non_blocking=None)¶
-
cpu()¶ 如果此存储不在 CPU 上,则返回其在 CPU 上的副本。
-
cuda(device=None, non_blocking=False, **kwargs)¶
-
data_ptr()¶
-
property
device¶
-
double()¶ 将此存储转换为双精度类型
-
element_size()¶
-
fill_(value)¶
-
float()¶ 将此存储转换为浮点类型
-
classmethod
from_buffer(*args, **kwargs)¶
-
classmethod
from_file(filename, shared, size)¶
-
get_device()¶
-
half()¶ 将此存储转换为半精度类型
-
int()¶ 将此存储转换为 int 类型
-
property
is_cuda¶
-
is_pinned()¶
-
is_sparse= False¶
-
long()¶ 将此存储转换为长整型
-
nbytes()¶
-
pickle_storage_type()¶
-
pin_memory()¶ 如果存储尚未固定,则将其复制到固定内存中。
-
resize_(size)¶
将存储移动到共享内存。
对于已经位于共享内存中的存储以及不需要跨进程共享的 CUDA 存储,此操作不会产生任何效果。共享内存中的存储无法调整大小。
返回值: self
-
short()¶ 将此存储转换为 short 类型
-
size()¶
-
tolist()¶ 返回一个包含此存储元素的列表
-
type(dtype=None, non_blocking=False)¶
-
-
class
torch.QUInt4x2Storage(*args, **kwargs)[source]¶ -
bfloat16()¶ 将此存储转换为 bfloat16 类型
-
bool()¶ 将此存储转换为布尔类型
-
byte()¶ 将此存储转换为字节类型
-
char()¶ 将此存储转换为字符类型
-
clone()¶ 返回此存储的副本
-
complex_double()¶ 将此存储转换为复数双精度类型
-
complex_float()¶ 将此存储转换为复数浮点类型
-
copy_(source, non_blocking=None)¶
-
cpu()¶ 如果此存储不在 CPU 上,则返回其在 CPU 上的副本。
-
cuda(device=None, non_blocking=False, **kwargs)¶
-
data_ptr()¶
-
property
device¶
-
double()¶ 将此存储转换为双精度类型
-
element_size()¶
-
fill_(value)¶
-
float()¶ 将此存储转换为浮点类型
-
classmethod
from_buffer(*args, **kwargs)¶
-
classmethod
from_file(filename, shared, size)¶
-
get_device()¶
-
half()¶ 将此存储转换为半精度类型
-
int()¶ 将此存储转换为 int 类型
-
property
is_cuda¶
-
is_pinned()¶
-
is_sparse= False¶
-
long()¶ 将此存储转换为长整型
-
nbytes()¶
-
pickle_storage_type()¶
-
pin_memory()¶ 如果存储尚未固定,则将其复制到固定内存中。
-
resize_(size)¶
将存储移动到共享内存。
对于已经位于共享内存中的存储以及不需要跨进程共享的 CUDA 存储,此操作不会产生任何效果。共享内存中的存储无法调整大小。
返回值: self
-
short()¶ 将此存储转换为 short 类型
-
size()¶
-
tolist()¶ 返回一个包含此存储元素的列表
-
type(dtype=None, non_blocking=False)¶
-