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', 'cpu' or 'disk' 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.
On impl='c' the gradient matches Full() to rounding. On impl='eager'
and PropJax it does too, except on the outermost M to M + 1 cells
next to an absorbing face (M = spatial_order // 2); pass
boundary_buffer=M + 1 to the propagator to remove that error. See
"Boundary saving next to the PML" in the propagators guide.
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,
cpml_strips: bool | None = None,
steps_per_call: int | None = None,
compile_cpp_wrapper: bool | None = None,
compile_combo_kernels: bool | None = None,
)
Options of impl='eager', passed as PropTorch(eager_options=...).
cpml_strips keeps the CPML memory fields (those whose spec names a
cpml_axis) on the absorbing strips only; see sweep.equations._cpml.
None, the default, decides by grid: strips on a 3-D grid, the full grid
on a 2-D one and with topography=. True or False forces a layout
(True with topography= raises). The layout only changes where the
memory fields are kept: snapshots (return_wavefield=True) and
last_wavefields hold full-grid fields either way.
The strips skip the CPML's full-grid memory traffic but add kernels, so they
pay off when the absorbing layers are a small part of the grid. They cut the
peak memory of a forward without gradients by about a third and of boundary
saving by a fifth to a third (3-D, abcn=50); with checkpointing, the
eager default, by 3-9%. A 2-D step of ~1000^2 cells is launch-bound, and
strips make it slower; a 2-D gradient call of about 3 million cells per
field or more (shots x padded grid cells: 3 shots of 1000^2) runs faster
with them (1.2-2x on an RTX 6000 Ada; see the user guide's C-PML memory
fields on the absorbing strips). In 3-D with abcn=50 (A100, V100,
compiled) the acoustic forward is faster from about 128^3 inner cells and
its gradient from about 160^3; smaller grids, and elastic gradients up to
160^3, run 5-50% slower, where cpml_strips=False is faster.
steps_per_call is how many time steps one call of the compiled step
advances on the full-tape, checkpointed and boundary-saving rollouts, with
the source injection and the receiver sampling inside the call. A call costs the
host 0.2-0.5 ms (Dynamo's guards, the autograd wrappers, the kernel
launches) whatever it computes; on a 2-D grid that is longer than the step
takes the GPU, which then idles between steps. None (the default)
takes 4 for a rollout that autograd records on a 2-D grid on a GPU, and 1
otherwise: a 3-D step keeps the GPU busy on its own, on a CPU the compute
dwarfs the overhead, and without gradients Inductor fuses the steps of a
call into one another in ways that can cost more GPU time on a large grid
than the call saves the host (twice the step's time at 2000^2, acoustic).
An explicit value applies with and without gradients.
The calls start on multiples of steps_per_call; the steps before the
first one (until the inputs' requires_grad settles and a multiple is
reached) and the last nt % steps_per_call run uncompiled, so no graph
is compiled for a remainder, and a checkpoint chunk is rounded up to whole
calls. Under boundary saving the backward pass reconstructs the inputs of
a call's steps in one call and differentiates the steps in another, each
at its own reconstructed input, so the gradient is that of one step a call
up to float32 round-off. return_wavefield=True advances one step a
call. A first compile takes longer the more steps a call holds.
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,
cpml_strips: bool | None = None,
steps_per_call: int | None = None,
compile_cpp_wrapper: bool | None = None,
compile_combo_kernels: bool | None = None,
)
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, cpml_strips: 'bool | None' = None, steps_per_call: 'int | None' = None, compile_cpp_wrapper: 'bool | None' = None, compile_combo_kernels: 'bool | None' = None)
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'.