Propagator options¶
Dataclass-based option blocks that configure the PropTorch execution paths.
Pass them through backend_options=, eager_options=, cuda_options= on the
PropTorch constructor, or use the top-level kwargs that mirror the dataclass
fields; PropJax accepts none of these blocks (it takes memory= and
scan_unroll=). The gradient-memory mode (full / boundary / ckpt) is
picked once via memory=Full() / memory=BoundarySaving(...) /
memory=Ckpt(...), on PropTorch and PropJax alike, and resolved
identically for every backend by resolve_memory_strategy. The older
MemoryOptions(strategy=...) and boundary_saving_config={...} spellings
still work and emit a DeprecationWarning.
Memory strategies (every impl)¶
memory= takes exactly one of these; BoundarySaving and Ckpt carry the
fields of BoundaryOptions and CkptOptions below. Not every backend
implements every field, and an unsupported one raises at construction:
eager boundary saving stores to 'gpu' or 'cpu' and has no tail_steps;
PropJax boundary saving keeps the ring on the device (storage='gpu') and
has no tail_steps; eager and PropJax checkpointing are mode='chunk' only.
sweep.propagator.options.Full ¶
Keep everything the backward needs in memory. No parameters, by nature.
strategy
class-attribute
¶
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
sweep.propagator.options.BoundarySaving ¶
BoundarySaving(
storage: Literal[gpu, cpu, disk] = "gpu",
transfer_interval: int | None = None,
pinned_memory: bool | None = None,
disk_dir: str | None = None,
ring_buffers: int | None = None,
disk_async_read: bool = False,
storage_dtype: Literal[fp32, fp16, bf16, int8] = "fp32",
tail_steps: int | None = None,
)
Bases: sweep.propagator.options.BoundaryOptions
Reconstruct the forward wavefield from saved boundary values.
strategy
class-attribute
¶
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
sweep.propagator.options.Ckpt ¶
Ckpt(
mode: Literal[chunk, recursive] = "chunk",
chunks: int = 100,
count: int = 0,
storage: Literal[gpu, cpu] = "gpu",
pinned_memory: bool | None = None,
)
Bases: sweep.propagator.options.CkptOptions
Rematerialise the forward wavefield from checkpoints.
strategy
class-attribute
¶
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
sweep.propagator.options.resolve_memory_strategy ¶
Resolve the three-way gradient-memory mode: 'full' | 'boundary' | 'ckpt'.
One mode wins, identically for every backend. Conflicting explicit
requests raise instead of silently preferring one path (historically
use_ckpt -- which defaulted to True -- beat an explicitly enabled
boundary_saving_config, so "boundary" test scripts silently ran the
checkpoint backward).
Requests: memory.strategy (if set), use_ckpt=True (-> 'ckpt'),
boundary_saving_config['enabled']=True (-> 'boundary').
An explicit legacy off-switch (use_ckpt=False, enabled=False) is
not a vote for the other trick: with no positive request it selects
'full'. That is what impl='c', use_ckpt=False has always meant --
the knob suppressed the boundary-saving default outright -- and what the
README and notebooks 00/12/16 document. The implicit backend default
('boundary' for impl='c', 'ckpt' otherwise) applies only when no
gradient-memory knob was passed at all.
Eager (impl='eager')¶
sweep.propagator.options.EagerOptions ¶
EagerOptions(
use_compile: bool = True,
compile_mode: str = "default",
compile_dynamic: bool = False,
compile_backend: str | None = None,
compile_fullgraph: bool = False,
store_last_wavefield: bool = False,
)
EagerOptions(use_compile: 'bool' = True, compile_mode: 'str' = 'default', compile_dynamic: 'bool' = False, compile_backend: 'str | None' = None, compile_fullgraph: 'bool' = False, store_last_wavefield: 'bool' = False)
compile_dynamic
class-attribute
¶
bool(x) -> bool
Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.
compile_fullgraph
class-attribute
¶
bool(x) -> bool
Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.
compile_mode
class-attribute
¶
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
store_last_wavefield
class-attribute
¶
bool(x) -> bool
Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.
use_compile
class-attribute
¶
bool(x) -> bool
Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.
CUDA core (impl='c')¶
Pass the memory strategy as memory= on PropTorch; CUDAOptions(memory=...)
is equivalent on impl='c'.
sweep.propagator.options.CUDAOptions ¶
CUDAOptions(memory: 'MemoryOptions | None' = None)
Boundary saving¶
sweep.propagator.options.BoundaryOptions ¶
BoundaryOptions(
storage: Literal[gpu, cpu, disk] = "gpu",
transfer_interval: int | None = None,
pinned_memory: bool | None = None,
disk_dir: str | None = None,
ring_buffers: int | None = None,
disk_async_read: bool = False,
storage_dtype: Literal[fp32, fp16, bf16, int8] = "fp32",
tail_steps: int | None = None,
)
BoundaryOptions(storage: "Literal['gpu', 'cpu', 'disk']" = 'gpu', transfer_interval: 'int | None' = None, pinned_memory: 'bool | None' = None, disk_dir: 'str | None' = None, ring_buffers: 'int | None' = None, disk_async_read: 'bool' = False, storage_dtype: "Literal['fp32', 'fp16', 'bf16', 'int8']" = 'fp32', tail_steps: 'int | None' = None)
disk_async_read
class-attribute
¶
bool(x) -> bool
Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.
storage
class-attribute
¶
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
storage_dtype
class-attribute
¶
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
Checkpointing¶
sweep.propagator.options.CkptOptions ¶
CkptOptions(
mode: Literal[chunk, recursive] = "chunk",
chunks: int = 100,
count: int = 0,
storage: Literal[gpu, cpu] = "gpu",
pinned_memory: bool | None = None,
)
CkptOptions(mode: "Literal['chunk', 'recursive']" = 'chunk', chunks: 'int' = 100, count: 'int' = 0, storage: "Literal['gpu', 'cpu']" = 'gpu', pinned_memory: 'bool | None' = None)
chunks
class-attribute
¶
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
count
class-attribute
¶
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
mode
class-attribute
¶
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
storage
class-attribute
¶
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
Deprecated¶
MemoryOptions(strategy=..., boundary=..., ckpt=...) is the old spelling of
memory=. It still works, is read exactly as before, and emits a
DeprecationWarning; use Full() / BoundarySaving(...) / Ckpt(...).
sweep.propagator.options.MemoryOptions ¶
MemoryOptions(
strategy: Literal["full", "boundary", "ckpt"] | None = None,
boundary: BoundaryOptions | None = None,
ckpt: CkptOptions | None = None,
)
MemoryOptions(strategy: "Literal['full', 'boundary', 'ckpt'] | None" = None, boundary: 'BoundaryOptions | None' = None, ckpt: 'CkptOptions | None' = None)
Defaults¶
sweep.propagator.options.PropagatorDefaults ¶
PropagatorDefaults(
abcn: int = 50,
free_surface: bool = False,
dh: float = 10.0,
dt: float = 0.002,
dev: str | None = None,
use_ckpt: bool | None = None,
nt: int = -1,
batch_size: int = 1,
allow_growth: bool = True,
)
PropagatorDefaults(abcn: 'int' = 50, free_surface: 'bool' = False, dh: 'float' = 10.0, dt: 'float' = 0.002, dev: 'str | None' = None, use_ckpt: 'bool | None' = None, nt: 'int' = -1, batch_size: 'int' = 1, allow_growth: 'bool' = True)
abcn
class-attribute
¶
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
allow_growth
class-attribute
¶
bool(x) -> bool
Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.
batch_size
class-attribute
¶
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
free_surface
class-attribute
¶
bool(x) -> bool
Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.
nt
class-attribute
¶
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
sweep.propagator.options.EagerDefaults ¶
EagerDefaults(
use_compile: bool = True,
compile_mode: str = "default",
compile_dynamic: bool = False,
compile_backend: str | None = None,
compile_fullgraph: bool = False,
store_last_wavefield: bool = False,
)
EagerDefaults(use_compile: 'bool' = True, compile_mode: 'str' = 'default', compile_dynamic: 'bool' = False, compile_backend: 'str | None' = None, compile_fullgraph: 'bool' = False, store_last_wavefield: 'bool' = False)
compile_dynamic
class-attribute
¶
bool(x) -> bool
Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.
compile_fullgraph
class-attribute
¶
bool(x) -> bool
Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.
compile_mode
class-attribute
¶
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
store_last_wavefield
class-attribute
¶
bool(x) -> bool
Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.
use_compile
class-attribute
¶
bool(x) -> bool
Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.
sweep.propagator.options.CkptDefaults ¶
CkptDefaults(
mode: Literal[chunk, recursive] = "chunk",
chunks: int = 100,
count: int = 0,
storage: Literal[gpu, cpu] = "gpu",
pinned_memory: bool | None = None,
cpu_pinned_memory: bool = True,
)
CkptDefaults(mode: "Literal['chunk', 'recursive']" = 'chunk', chunks: 'int' = 100, count: 'int' = 0, storage: "Literal['gpu', 'cpu']" = 'gpu', pinned_memory: 'bool | None' = None, cpu_pinned_memory: 'bool' = True)
chunks
class-attribute
¶
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
count
class-attribute
¶
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
cpu_pinned_memory
class-attribute
¶
bool(x) -> bool
Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.
mode
class-attribute
¶
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
storage
class-attribute
¶
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
sweep.propagator.options.BoundaryDefaults ¶
BoundaryDefaults(
enabled: bool = False,
storage: Literal[gpu, cpu, disk] = "gpu",
transfer_interval: int | None = None,
pinned_memory: bool | None = None,
disk_dir: str | None = None,
ring_buffers: int | None = None,
disk_async_read: bool = False,
gpu_transfer_interval: int = 1,
gpu_pinned_memory: bool = False,
gpu_ring_buffers: int = 1,
cpu_transfer_interval: int = 64,
cpu_ring_buffers: int = 1,
cpu_pinned_memory: bool = True,
disk_transfer_interval: int = 32,
disk_async_transfer_interval_2d: int = 40,
disk_async_transfer_interval_3d: int = 16,
disk_ring_buffers_2d: int = 3,
disk_ring_buffers_3d: int = 2,
disk_async_ring_buffers: int = 2,
)
BoundaryDefaults(enabled: 'bool' = False, storage: "Literal['gpu', 'cpu', 'disk']" = 'gpu', transfer_interval: 'int | None' = None, pinned_memory: 'bool | None' = None, disk_dir: 'str | None' = None, ring_buffers: 'int | None' = None, disk_async_read: 'bool' = False, gpu_transfer_interval: 'int' = 1, gpu_pinned_memory: 'bool' = False, gpu_ring_buffers: 'int' = 1, cpu_transfer_interval: 'int' = 64, cpu_ring_buffers: 'int' = 1, cpu_pinned_memory: 'bool' = True, disk_transfer_interval: 'int' = 32, disk_async_transfer_interval_2d: 'int' = 40, disk_async_transfer_interval_3d: 'int' = 16, disk_ring_buffers_2d: 'int' = 3, disk_ring_buffers_3d: 'int' = 2, disk_async_ring_buffers: 'int' = 2)
cpu_pinned_memory
class-attribute
¶
bool(x) -> bool
Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.
cpu_ring_buffers
class-attribute
¶
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
cpu_transfer_interval
class-attribute
¶
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
disk_async_read
class-attribute
¶
bool(x) -> bool
Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.
disk_async_ring_buffers
class-attribute
¶
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
disk_async_transfer_interval_2d
class-attribute
¶
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
disk_async_transfer_interval_3d
class-attribute
¶
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
disk_ring_buffers_2d
class-attribute
¶
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
disk_ring_buffers_3d
class-attribute
¶
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
disk_transfer_interval
class-attribute
¶
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
enabled
class-attribute
¶
bool(x) -> bool
Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.
gpu_pinned_memory
class-attribute
¶
bool(x) -> bool
Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.
gpu_ring_buffers
class-attribute
¶
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
gpu_transfer_interval
class-attribute
¶
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
storage
class-attribute
¶
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.