diff --git a/2.7/amp.html b/2.7/amp.html index 161834c67a8..6d90db42da8 100644 --- a/2.7/amp.html +++ b/2.7/amp.html @@ -646,7 +646,7 @@
Return a bool indicating if autocast is available on device_type
.
Instances of autocast
serve as context managers or decorators that
allow regions of your script to run in mixed precision.
In these regions, ops run in an op-specific dtype chosen by autocast @@ -828,7 +828,7 @@
Create a helper decorator for forward
methods of custom autograd functions.
Autograd functions are subclasses of torch.autograd.Function
.
See the example page for more detail.
Create a helper decorator for backward methods of custom autograd functions.
Autograd functions are subclasses of torch.autograd.Function
.
Ensures that backward
executes with the same autocast state as forward
.
@@ -871,7 +871,7 @@
See torch.autocast
.
torch.cuda.amp.autocast(args...)
is deprecated. Please use torch.amp.autocast("cuda", args...)
instead.
torch.cuda.amp.custom_fwd(args...)
is deprecated. Please use
torch.amp.custom_fwd(args..., device_type='cuda')
instead.
torch.cuda.amp.custom_bwd(args...)
is deprecated. Please use
torch.amp.custom_bwd(args..., device_type='cuda')
instead.
See torch.autocast
.
torch.cpu.amp.autocast(args...)
is deprecated. Please use torch.amp.autocast("cpu", args...)
instead.
See torch.amp.GradScaler
.
torch.cuda.amp.GradScaler(args...)
is deprecated. Please use torch.amp.GradScaler("cuda", args...)
instead.
See torch.amp.GradScaler
.
torch.cpu.amp.GradScaler(args...)
is deprecated. Please use torch.amp.GradScaler("cpu", args...)
instead.
Base class to create custom autograd.Function.
To create a custom autograd.Function, subclass this class and implement
the forward()
and backward()
static methods. Then, to use your custom
@@ -925,7 +925,7 @@
emit_itt
.
Context manager that manages autograd profiler state and holds a summary of results.
Under the hood it just records events of functions being executed in C++ and exposes those events to Python. You can wrap any code into it and it will @@ -1034,7 +1034,7 @@
Context manager that makes every autograd operation emit an NVTX range.
It is useful when running the program under nvprof:
nvprof --profile-from-start off -o trace_name.prof -- <regular command here>
@@ -1103,7 +1103,7 @@ Profiler
-
-class torch.autograd.profiler.emit_itt(enabled=True, record_shapes=False)[source][source]¶
+class torch.autograd.profiler.emit_itt(enabled=True, record_shapes=False)[source][source]¶
Context manager that makes every autograd operation emit an ITT range.
It is useful when running the program under Intel(R) VTune Profiler:
vtune <--vtune-flags> <regular command here>
@@ -1149,7 +1149,7 @@ Profiler¶
-
-class torch.autograd.detect_anomaly(check_nan=True)[source][source]¶
+class torch.autograd.detect_anomaly(check_nan=True)[source][source]¶
Context-manager that enable anomaly detection for the autograd engine.
This does two things:
@@ -1219,7 +1219,7 @@ Debugging and anomaly detection
-
-class torch.autograd.set_detect_anomaly(mode, check_nan=True)[source][source]¶
+class torch.autograd.set_detect_anomaly(mode, check_nan=True)[source][source]¶
Context-manager that sets the anomaly detection for the autograd engine on or off.
set_detect_anomaly
will enable or disable the autograd anomaly detection
based on its argument mode
.
@@ -1295,7 +1295,7 @@
Autograd graphHooks for saved tensors.
-
-class torch.autograd.graph.saved_tensors_hooks(pack_hook, unpack_hook)[source][source]¶
+class torch.autograd.graph.saved_tensors_hooks(pack_hook, unpack_hook)[source][source]¶
Context-manager that sets a pair of pack / unpack hooks for saved tensors.
Use this context-manager to define how intermediary results of an operation
should be packed before saving, and unpacked on retrieval.
@@ -1356,7 +1356,7 @@ Autograd graph
-
-class torch.autograd.graph.save_on_cpu(pin_memory=False, device_type='cuda')[source][source]¶
+class torch.autograd.graph.save_on_cpu(pin_memory=False, device_type='cuda')[source][source]¶
Context manager under which tensors saved by the forward pass will be stored on cpu, then retrieved for backward.
When performing operations within this context manager, intermediary
results saved in the graph during the forward pass will be moved to CPU,
@@ -1396,7 +1396,7 @@
Autograd graph
-
-class torch.autograd.graph.disable_saved_tensors_hooks(error_message)[source][source]¶
+class torch.autograd.graph.disable_saved_tensors_hooks(error_message)[source][source]¶
Context-manager that disables the saved tensors default hooks feature.
Useful for if you are creating a feature that does not work with saved
tensors default hooks.
@@ -1422,7 +1422,7 @@ Autograd graph
-
-class torch.autograd.graph.register_multi_grad_hook(tensors, fn, *, mode='all')[source][source]¶
+class torch.autograd.graph.register_multi_grad_hook(tensors, fn, *, mode='all')[source][source]¶
Register a multi-grad backward hook.
There are two supported modes: "all"
and "any"
.
Under the "all"
mode, the hook will be called after gradients with respect to every tensor in
@@ -1473,7 +1473,7 @@
Autograd graph
-
-class torch.autograd.graph.allow_mutation_on_saved_tensors[source][source]¶
+class torch.autograd.graph.allow_mutation_on_saved_tensors[source][source]¶
Context manager under which mutating tensors saved for backward is allowed.
Under this context manager, tensors saved for backward are cloned on mutation,
so the original version can still be used during backward. Normally, mutating a tensor
@@ -1509,7 +1509,7 @@
Autograd graph
-
-class torch.autograd.graph.GradientEdge(node, output_nr)[source][source]¶
+class torch.autograd.graph.GradientEdge(node, output_nr)[source][source]¶
Object representing a given gradient edge within the autograd graph.
To get the gradient edge where a given Tensor gradient will be computed,
you can do edge = autograd.graph.get_gradient_edge(tensor)
.
@@ -1519,7 +1519,7 @@ Autograd graph
-
-torch.autograd.graph.get_gradient_edge(tensor)[source][source]¶
+torch.autograd.graph.get_gradient_edge(tensor)[source][source]¶
Get the gradient edge for computing the gradient of the given Tensor.
In particular, it is equivalent to call
g = autograd.grad(loss, input)
and g = autograd.grad(loss, get_gradient_edge(input))
.
diff --git a/2.7/backends.html b/2.7/backends.html
index c42844f0ede..87c64cfd636 100644
--- a/2.7/backends.html
+++ b/2.7/backends.html
@@ -612,7 +612,7 @@
torch.backends.cpu¶
-
-torch.backends.cpu.get_cpu_capability()[source][source]¶
+torch.backends.cpu.get_cpu_capability()[source][source]¶
Return cpu capability as a string value.
Possible values:
- “DEFAULT”
@@ -634,7 +634,7 @@
torch.backends.cuda¶
-
-torch.backends.cuda.is_built()[source][source]¶
+torch.backends.cuda.is_built()[source][source]¶
Return whether PyTorch is built with CUDA support.
Note that this doesn’t necessarily mean CUDA is available; just that if this PyTorch
binary were run on a machine with working CUDA drivers and devices, we would be able to use it.
@@ -686,7 +686,7 @@
-
-torch.backends.cuda.preferred_blas_library(backend=None)[source][source]¶
+torch.backends.cuda.preferred_blas_library(backend=None)[source][source]¶
Override the library PyTorch uses for BLAS operations. Choose between cuBLAS, cuBLASLt, and CK [ROCm-only].
Warning
@@ -719,7 +719,7 @@
-
-torch.backends.cuda.preferred_rocm_fa_library(backend=None)[source][source]¶
+torch.backends.cuda.preferred_rocm_fa_library(backend=None)[source][source]¶
[ROCm-only]
Override the backend PyTorch uses in ROCm environments for Flash Attention. Choose between AOTriton and CK
@@ -749,7 +749,7 @@
-
-torch.backends.cuda.preferred_linalg_library(backend=None)[source][source]¶
+torch.backends.cuda.preferred_linalg_library(backend=None)[source][source]¶
Override the heuristic PyTorch uses to choose between cuSOLVER and MAGMA for CUDA linear algebra operations.
Warning
@@ -804,7 +804,7 @@
-
-torch.backends.cuda.flash_sdp_enabled()[source][source]¶
+torch.backends.cuda.flash_sdp_enabled()[source][source]¶
-
Warning
This flag is beta and subject to change.
@@ -814,7 +814,7 @@
-
-torch.backends.cuda.enable_mem_efficient_sdp(enabled)[source][source]¶
+torch.backends.cuda.enable_mem_efficient_sdp(enabled)[source][source]¶
-
Warning
This flag is beta and subject to change.
@@ -826,7 +826,7 @@
-
-torch.backends.cuda.mem_efficient_sdp_enabled()[source][source]¶
+torch.backends.cuda.mem_efficient_sdp_enabled()[source][source]¶
-
Warning
This flag is beta and subject to change.
@@ -836,7 +836,7 @@
-
-torch.backends.cuda.enable_flash_sdp(enabled)[source][source]¶
+torch.backends.cuda.enable_flash_sdp(enabled)[source][source]¶
-
Warning
This flag is beta and subject to change.
@@ -848,7 +848,7 @@
-
-torch.backends.cuda.math_sdp_enabled()[source][source]¶
+torch.backends.cuda.math_sdp_enabled()[source][source]¶
-
Warning
This flag is beta and subject to change.
@@ -858,7 +858,7 @@
-
-torch.backends.cuda.enable_math_sdp(enabled)[source][source]¶
+torch.backends.cuda.enable_math_sdp(enabled)[source][source]¶
-
Warning
This flag is beta and subject to change.
@@ -870,7 +870,7 @@
-
-torch.backends.cuda.fp16_bf16_reduction_math_sdp_allowed()[source][source]¶
+torch.backends.cuda.fp16_bf16_reduction_math_sdp_allowed()[source][source]¶
-
Warning
This flag is beta and subject to change.
@@ -880,7 +880,7 @@
-
-torch.backends.cuda.allow_fp16_bf16_reduction_math_sdp(enabled)[source][source]¶
+torch.backends.cuda.allow_fp16_bf16_reduction_math_sdp(enabled)[source][source]¶
-
Warning
This flag is beta and subject to change.
@@ -892,7 +892,7 @@
-
-torch.backends.cuda.cudnn_sdp_enabled()[source][source]¶
+torch.backends.cuda.cudnn_sdp_enabled()[source][source]¶
-
Warning
This flag is beta and subject to change.
@@ -902,7 +902,7 @@
-
-torch.backends.cuda.enable_cudnn_sdp(enabled)[source][source]¶
+torch.backends.cuda.enable_cudnn_sdp(enabled)[source][source]¶
-
Warning
This flag is beta and subject to change.
@@ -914,7 +914,7 @@
-
-torch.backends.cuda.is_flash_attention_available()[source][source]¶
+torch.backends.cuda.is_flash_attention_available()[source][source]¶
Check if PyTorch was built with FlashAttention for scaled_dot_product_attention.
- Returns
@@ -933,7 +933,7 @@
-
-torch.backends.cuda.can_use_flash_attention(params, debug=False)[source][source]¶
+torch.backends.cuda.can_use_flash_attention(params, debug=False)[source][source]¶
Check if FlashAttention can be utilized in scaled_dot_product_attention.
- Parameters
@@ -961,7 +961,7 @@
-
-torch.backends.cuda.can_use_efficient_attention(params, debug=False)[source][source]¶
+torch.backends.cuda.can_use_efficient_attention(params, debug=False)[source][source]¶
Check if efficient_attention can be utilized in scaled_dot_product_attention.
- Parameters
@@ -989,7 +989,7 @@
-
-torch.backends.cuda.can_use_cudnn_attention(params, debug=False)[source][source]¶
+torch.backends.cuda.can_use_cudnn_attention(params, debug=False)[source][source]¶
Check if cudnn_attention can be utilized in scaled_dot_product_attention.
- Parameters
@@ -1017,7 +1017,7 @@
-
-torch.backends.cuda.sdp_kernel(enable_flash=True, enable_math=True, enable_mem_efficient=True, enable_cudnn=True)[source][source]¶
+torch.backends.cuda.sdp_kernel(enable_flash=True, enable_math=True, enable_mem_efficient=True, enable_cudnn=True)[source][source]¶
-
Warning
This flag is beta and subject to change.
@@ -1033,13 +1033,13 @@
torch.backends.cudnn¶
-
-torch.backends.cudnn.version()[source][source]¶
+torch.backends.cudnn.version()[source][source]¶
Return the version of cuDNN.
-
-torch.backends.cudnn.is_available()[source][source]¶
+torch.backends.cudnn.is_available()[source][source]¶
Return a bool indicating if CUDNN is currently available.
@@ -1085,7 +1085,7 @@
torch.backends.cusparselt¶
-
-torch.backends.cusparselt.version()[source][source]¶
+torch.backends.cusparselt.version()[source][source]¶
Return the version of cuSPARSELt
- Return type
@@ -1096,7 +1096,7 @@
-
-torch.backends.cusparselt.is_available()[source][source]¶
+torch.backends.cusparselt.is_available()[source][source]¶
Return a bool indicating if cuSPARSELt is currently available.
- Return type
@@ -1110,7 +1110,7 @@
torch.backends.mha¶
-
-torch.backends.mha.get_fastpath_enabled()[source][source]¶
+torch.backends.mha.get_fastpath_enabled()[source][source]¶
Returns whether fast path for TransformerEncoder and MultiHeadAttention
is enabled, or True
if jit is scripting.
@@ -1127,7 +1127,7 @@
-
-torch.backends.mha.set_fastpath_enabled(value)[source][source]¶
+torch.backends.mha.set_fastpath_enabled(value)[source][source]¶
Sets whether fast path is enabled
@@ -1138,7 +1138,7 @@
torch.backends.mps¶
-
-torch.backends.mps.is_available()[source][source]¶
+torch.backends.mps.is_available()[source][source]¶
Return a bool indicating if MPS is currently available.
- Return type
@@ -1149,7 +1149,7 @@
-
-torch.backends.mps.is_built()[source][source]¶
+torch.backends.mps.is_built()[source][source]¶
Return whether PyTorch is built with MPS support.
Note that this doesn’t necessarily mean MPS is available; just that
if this PyTorch binary were run a machine with working MPS drivers
@@ -1166,13 +1166,13 @@
torch.backends.mkl¶
-
-torch.backends.mkl.is_available()[source][source]¶
+torch.backends.mkl.is_available()[source][source]¶
Return whether PyTorch is built with MKL support.
-
-class torch.backends.mkl.verbose(enable)[source][source]¶
+class torch.backends.mkl.verbose(enable)[source][source]¶
On-demand oneMKL verbosing functionality.
To make it easier to debug performance issues, oneMKL can dump verbose
messages containing execution information like duration while executing
@@ -1204,13 +1204,13 @@
torch.backends.mkldnn¶
-
-torch.backends.mkldnn.is_available()[source][source]¶
+torch.backends.mkldnn.is_available()[source][source]¶
Return whether PyTorch is built with MKL-DNN support.
-
-class torch.backends.mkldnn.verbose(level)[source][source]¶
+class torch.backends.mkldnn.verbose(level)[source][source]¶
On-demand oneDNN (former MKL-DNN) verbosing functionality.
To make it easier to debug performance issues, oneDNN can dump verbose
messages containing information like kernel size, input data size and
@@ -1243,19 +1243,19 @@
torch.backends.nnpack¶
-
-torch.backends.nnpack.is_available()[source][source]¶
+torch.backends.nnpack.is_available()[source][source]¶
Return whether PyTorch is built with NNPACK support.
-
-torch.backends.nnpack.flags(enabled=False)[source][source]¶
+torch.backends.nnpack.flags(enabled=False)[source][source]¶
Context manager for setting if nnpack is enabled globally
-
-torch.backends.nnpack.set_flags(_enabled)[source][source]¶
+torch.backends.nnpack.set_flags(_enabled)[source][source]¶
Set if nnpack is enabled globally
@@ -1264,7 +1264,7 @@
torch.backends.openmp¶
-
-torch.backends.openmp.is_available()[source][source]¶
+torch.backends.openmp.is_available()[source][source]¶
Return whether PyTorch is built with OpenMP support.
@@ -1273,7 +1273,7 @@
torch.backends.opt_einsum¶
-
-torch.backends.opt_einsum.is_available()[source][source]¶
+torch.backends.opt_einsum.is_available()[source][source]¶
Return a bool indicating if opt_einsum is currently available.
You must install opt-einsum in order for torch to automatically optimize einsum. To
make opt-einsum available, you can install it along with torch: pip install torch[opt-einsum]
@@ -1289,7 +1289,7 @@
-
-torch.backends.opt_einsum.get_opt_einsum()[source][source]¶
+torch.backends.opt_einsum.get_opt_einsum()[source][source]¶
Return the opt_einsum package if opt_einsum is currently available, else None.
- Return type
diff --git a/2.7/benchmark_utils.html b/2.7/benchmark_utils.html
index 790eff7a542..3f4509e0228 100644
--- a/2.7/benchmark_utils.html
+++ b/2.7/benchmark_utils.html
@@ -594,7 +594,7 @@
Benchmark Utils - torch.utils.benchmark¶
-
-class torch.utils.benchmark.Timer(stmt='pass', setup='pass', global_setup='', timer=<built-in function perf_counter>, globals=None, label=None, sub_label=None, description=None, env=None, num_threads=1, language=Language.PYTHON)[source][source]¶
+class torch.utils.benchmark.Timer(stmt='pass', setup='pass', global_setup='', timer=<built-in function perf_counter>, globals=None, label=None, sub_label=None, description=None, env=None, num_threads=1, language=Language.PYTHON)[source][source]¶
Helper class for measuring execution time of PyTorch statements.
For a full tutorial on how to use this class, see:
https://pytorch.org/tutorials/recipes/recipes/benchmark.html
@@ -698,7 +698,7 @@
-
-adaptive_autorange(threshold=0.1, *, min_run_time=0.01, max_run_time=10.0, callback=None)[source][source]¶
+adaptive_autorange(threshold=0.1, *, min_run_time=0.01, max_run_time=10.0, callback=None)[source][source]¶
Similar to blocked_autorange but also checks for variablility in measurements
and repeats until iqr/median is smaller than threshold or max_run_time is reached.
At a high level, adaptive_autorange executes the following pseudo-code:
@@ -739,7 +739,7 @@
-
-blocked_autorange(callback=None, min_run_time=0.2)[source][source]¶
+blocked_autorange(callback=None, min_run_time=0.2)[source][source]¶
Measure many replicates while keeping timer overhead to a minimum.
At a high level, blocked_autorange executes the following pseudo-code:
`setup`
@@ -784,7 +784,7 @@
-
-collect_callgrind(number: int, *, repeats: None, collect_baseline: bool, retain_out_file: bool) CallgrindStats [source][source]¶
+collect_callgrind(number: int, *, repeats: None, collect_baseline: bool, retain_out_file: bool) CallgrindStats [source][source]¶
-
collect_callgrind(number: int, *, repeats: int, collect_baseline: bool, retain_out_file: bool) tuple[torch.utils.benchmark.utils.valgrind_wrapper.timer_interface.CallgrindStats, ...]
Collect instruction counts using Callgrind.
@@ -819,7 +819,7 @@
-
-timeit(number=1000000)[source][source]¶
+timeit(number=1000000)[source][source]¶
Mirrors the semantics of timeit.Timer.timeit().
Execute the main statement (stmt) number times.
https://docs.python.org/3/library/timeit.html#timeit.Timer.timeit
@@ -834,7 +834,7 @@
-
-class torch.utils.benchmark.Measurement(number_per_run, raw_times, task_spec, metadata=None)[source][source]¶
+class torch.utils.benchmark.Measurement(number_per_run, raw_times, task_spec, metadata=None)[source][source]¶
The result of a Timer measurement.
This class stores one or more measurements of a given statement. It is
serializable and provides several convenience methods
@@ -843,7 +843,7 @@
-
-static merge(measurements)[source][source]¶
+static merge(measurements)[source][source]¶
Convenience method for merging replicates.
Merge will extrapolate times to number_per_run=1 and will not
transfer any metadata. (Since it might differ between replicates)
@@ -873,7 +873,7 @@
-
-class torch.utils.benchmark.CallgrindStats(task_spec, number_per_run, built_with_debug_symbols, baseline_inclusive_stats, baseline_exclusive_stats, stmt_inclusive_stats, stmt_exclusive_stats, stmt_callgrind_out)[source][source]¶
+class torch.utils.benchmark.CallgrindStats(task_spec, number_per_run, built_with_debug_symbols, baseline_inclusive_stats, baseline_exclusive_stats, stmt_inclusive_stats, stmt_exclusive_stats, stmt_callgrind_out)[source][source]¶
Top level container for Callgrind results collected by Timer.
Manipulation is generally done using the FunctionCounts class, which is
obtained by calling CallgrindStats.stats(…). Several convenience
@@ -883,7 +883,7 @@
-
-as_standardized()[source][source]¶
+as_standardized()[source][source]¶
Strip library names and some prefixes from function strings.
When comparing two different sets of instruction counts, on stumbling
block can be path prefixes. Callgrind includes the full filepath
@@ -912,7 +912,7 @@
-
-counts(*, denoise=False)[source][source]¶
+counts(*, denoise=False)[source][source]¶
Returns the total number of instructions executed.
See FunctionCounts.denoise() for an explanation of the denoise arg.
@@ -924,7 +924,7 @@
-
-delta(other, inclusive=False)[source][source]¶
+delta(other, inclusive=False)[source][source]¶
Diff two sets of counts.
One common reason to collect instruction counts is to determine the
the effect that a particular change will have on the number of instructions
@@ -942,7 +942,7 @@
-
-stats(inclusive=False)[source][source]¶
+stats(inclusive=False)[source][source]¶
Returns detailed function counts.
Conceptually, the FunctionCounts returned can be thought of as a tuple
of (count, path_and_function_name) tuples.
@@ -962,7 +962,7 @@
-
-class torch.utils.benchmark.FunctionCounts(_data, inclusive, truncate_rows=True, _linewidth=None)[source][source]¶
+class torch.utils.benchmark.FunctionCounts(_data, inclusive, truncate_rows=True, _linewidth=None)[source][source]¶
Container for manipulating Callgrind results.
- It supports:
@@ -979,7 +979,7 @@
-
-denoise()[source][source]¶
+denoise()[source][source]¶
Remove known noisy instructions.
Several instructions in the CPython interpreter are rather noisy. These
instructions involve unicode to dictionary lookups which Python uses to
@@ -995,7 +995,7 @@
-
-filter(filter_fn)[source][source]¶
+filter(filter_fn)[source][source]¶
Keep only the elements where filter_fn applied to function name returns True.
- Return type
@@ -1006,7 +1006,7 @@
-
-transform(map_fn)[source][source]¶
+transform(map_fn)[source][source]¶
Apply map_fn to all of the function names.
This can be used to regularize function names (e.g. stripping irrelevant
parts of the file path), coalesce entries by mapping multiple functions
@@ -1022,7 +1022,7 @@
-
-class torch.utils.benchmark.Compare(results)[source][source]¶
+class torch.utils.benchmark.Compare(results)[source][source]¶
Helper class for displaying the results of many measurements in a
formatted table.
The table format is based on the information fields provided in
@@ -1038,33 +1038,33 @@
-
-colorize(rowwise=False)[source][source]¶
+colorize(rowwise=False)[source][source]¶
Colorize formatted table.
Colorize columnwise by default.
-
-extend_results(results)[source][source]¶
+extend_results(results)[source][source]¶
Append results to already stored ones.
All added results must be instances of Measurement
.
-
-highlight_warnings()[source][source]¶
+highlight_warnings()[source][source]¶
Enables warning highlighting when building formatted table.
-
-trim_significant_figures()[source][source]¶
+trim_significant_figures()[source][source]¶
Enables trimming of significant figures when building the formatted table.
diff --git a/2.7/checkpoint.html b/2.7/checkpoint.html
index a4d586a773c..7a98e2c4391 100644
--- a/2.7/checkpoint.html
+++ b/2.7/checkpoint.html
@@ -624,7 +624,7 @@ torch.utils.checkpoint
-
-torch.utils.checkpoint.checkpoint(function, *args, use_reentrant=None, context_fn=<function noop_context_fn>, determinism_check='default', debug=False, **kwargs)[source][source]¶
+torch.utils.checkpoint.checkpoint(function, *args, use_reentrant=None, context_fn=<function noop_context_fn>, determinism_check='default', debug=False, **kwargs)[source][source]¶
Checkpoint a model or part of the model.
Activation checkpointing is a technique that trades compute for memory.
Instead of keeping tensors needed for backward alive until they are used in
@@ -736,7 +736,7 @@
torch.utils.checkpoint
-
-torch.utils.checkpoint.checkpoint_sequential(functions, segments, input, use_reentrant=None, **kwargs)[source][source]¶
+torch.utils.checkpoint.checkpoint_sequential(functions, segments, input, use_reentrant=None, **kwargs)[source][source]¶
Checkpoint a sequential model to save memory.
Sequential models execute a list of modules/functions in order
(sequentially). Therefore, we can divide such a model in various segments
@@ -786,7 +786,7 @@
torch.utils.checkpoint
-
-torch.utils.checkpoint.set_checkpoint_debug_enabled(enabled)[source][source]¶
+torch.utils.checkpoint.set_checkpoint_debug_enabled(enabled)[source][source]¶
Context manager that sets whether checkpoint should print additional debug
information when running. See the debug
flag for
checkpoint()
for more information. Note that
@@ -802,7 +802,7 @@
torch.utils.checkpoint
-
-class torch.utils.checkpoint.CheckpointPolicy(value)[source][source]¶
+class torch.utils.checkpoint.CheckpointPolicy(value)[source][source]¶
Enum for specifying the policy for checkpointing during backpropagation.
The following policies are supported:
@@ -826,7 +826,7 @@ torch.utils.checkpoint
-
-class torch.utils.checkpoint.SelectiveCheckpointContext(*, is_recompute)[source][source]¶
+class torch.utils.checkpoint.SelectiveCheckpointContext(*, is_recompute)[source][source]¶
Context passed to policy function during selective checkpointing.
This class is used to pass relevant metadata to the policy function during
selective checkpointing. The metadata includes whether the current invocation
@@ -849,7 +849,7 @@
torch.utils.checkpoint
-
-torch.utils.checkpoint.create_selective_checkpoint_contexts(policy_fn_or_list, allow_cache_entry_mutation=False)[source][source]¶
+torch.utils.checkpoint.create_selective_checkpoint_contexts(policy_fn_or_list, allow_cache_entry_mutation=False)[source][source]¶
Helper to avoid recomputing certain ops during activation checkpointing.
Use this with torch.utils.checkpoint.checkpoint to control which
operations are recomputed during the backward pass.
diff --git a/2.7/cond.html b/2.7/cond.html
index 8e343bf2ab8..d30187996fa 100644
--- a/2.7/cond.html
+++ b/2.7/cond.html
@@ -760,7 +760,7 @@ Invariants of torch.ops.higher_order.cond¶
-
-torch._higher_order_ops.cond.cond(pred, true_fn, false_fn, operands=())[source]¶
+torch._higher_order_ops.cond.cond(pred, true_fn, false_fn, operands=())[source]¶
Conditionally applies true_fn or false_fn.
Warning
diff --git a/2.7/config_mod.html b/2.7/config_mod.html
index e9d00a02013..4eb5669c95e 100644
--- a/2.7/config_mod.html
+++ b/2.7/config_mod.html
@@ -594,7 +594,7 @@
torch.__config__¶
-
-torch.__config__.show()[source][source]¶
+torch.__config__.show()[source][source]¶
Return a human-readable string with descriptions of the
configuration of PyTorch.
@@ -606,7 +606,7 @@
-
-torch.__config__.parallel_info()[source][source]¶
+torch.__config__.parallel_info()[source][source]¶
Returns detailed string with parallelization settings
- Return type
diff --git a/2.7/cpp_extension.html b/2.7/cpp_extension.html
index d13c71708ba..8e2a6054058 100644
--- a/2.7/cpp_extension.html
+++ b/2.7/cpp_extension.html
@@ -594,7 +594,7 @@
torch.utils.cpp_extension¶
-
-torch.utils.cpp_extension.CppExtension(name, sources, *args, **kwargs)[source][source]¶
+torch.utils.cpp_extension.CppExtension(name, sources, *args, **kwargs)[source][source]¶
Create a setuptools.Extension
for C++.
Convenience method that creates a setuptools.Extension
with the
bare minimum (but often sufficient) arguments to build a C++ extension.
@@ -639,7 +639,7 @@ torch.utils.cpp_extension
-
-torch.utils.cpp_extension.CUDAExtension(name, sources, *args, **kwargs)[source][source]¶
+torch.utils.cpp_extension.CUDAExtension(name, sources, *args, **kwargs)[source][source]¶
Create a setuptools.Extension
for CUDA/C++.
Convenience method that creates a setuptools.Extension
with the
bare minimum (but often sufficient) arguments to build a CUDA/C++
@@ -744,7 +744,7 @@
torch.utils.cpp_extension
-
-torch.utils.cpp_extension.SyclExtension(name, sources, *args, **kwargs)[source][source]¶
+torch.utils.cpp_extension.SyclExtension(name, sources, *args, **kwargs)[source][source]¶
Creates a setuptools.Extension
for SYCL/C++.
Convenience method that creates a setuptools.Extension
with the
bare minimum (but often sufficient) arguments to build a SYCL/C++
@@ -796,7 +796,7 @@
torch.utils.cpp_extension
-
-torch.utils.cpp_extension.BuildExtension(*args, **kwargs)[source][source]¶
+torch.utils.cpp_extension.BuildExtension(*args, **kwargs)[source][source]¶
A custom setuptools
build extension .
This setuptools.build_ext
subclass takes care of passing the
minimum required compiler flags (e.g. -std=c++17
) as well as mixed
@@ -824,7 +824,7 @@
torch.utils.cpp_extension
-
-torch.utils.cpp_extension.load(name, sources, extra_cflags=None, extra_cuda_cflags=None, extra_sycl_cflags=None, extra_ldflags=None, extra_include_paths=None, build_directory=None, verbose=False, with_cuda=None, with_sycl=None, is_python_module=True, is_standalone=False, keep_intermediates=True)[source][source]¶
+torch.utils.cpp_extension.load(name, sources, extra_cflags=None, extra_cuda_cflags=None, extra_sycl_cflags=None, extra_ldflags=None, extra_include_paths=None, build_directory=None, verbose=False, with_cuda=None, with_sycl=None, is_python_module=True, is_standalone=False, keep_intermediates=True)[source][source]¶
Load a PyTorch C++ extension just-in-time (JIT).
To load an extension, a Ninja build file is emitted, which is used to
compile the given sources into a dynamic library. This library is
@@ -924,7 +924,7 @@
torch.utils.cpp_extension
-
-torch.utils.cpp_extension.load_inline(name, cpp_sources, cuda_sources=None, sycl_sources=None, functions=None, extra_cflags=None, extra_cuda_cflags=None, extra_sycl_cflags=None, extra_ldflags=None, extra_include_paths=None, build_directory=None, verbose=False, with_cuda=None, with_sycl=None, is_python_module=True, with_pytorch_error_handling=True, keep_intermediates=True, use_pch=False)[source][source]¶
+torch.utils.cpp_extension.load_inline(name, cpp_sources, cuda_sources=None, sycl_sources=None, functions=None, extra_cflags=None, extra_cuda_cflags=None, extra_sycl_cflags=None, extra_ldflags=None, extra_include_paths=None, build_directory=None, verbose=False, with_cuda=None, with_sycl=None, is_python_module=True, with_pytorch_error_handling=True, keep_intermediates=True, use_pch=False)[source][source]¶
Load a PyTorch C++ extension just-in-time (JIT) from string sources.
This function behaves exactly like load()
, but takes its sources as
strings rather than filenames. These strings are stored to files in the
@@ -1017,7 +1017,7 @@
torch.utils.cpp_extension
-
-torch.utils.cpp_extension.include_paths(device_type='cpu')[source][source]¶
+torch.utils.cpp_extension.include_paths(device_type='cpu')[source][source]¶
Get the include paths required to build a C++ or CUDA or SYCL extension.
- Parameters
@@ -1034,7 +1034,7 @@ torch.utils.cpp_extension
-
-torch.utils.cpp_extension.get_compiler_abi_compatibility_and_version(compiler)[source][source]¶
+torch.utils.cpp_extension.get_compiler_abi_compatibility_and_version(compiler)[source][source]¶
Determine if the given compiler is ABI-compatible with PyTorch alongside its version.
- Parameters
@@ -1053,13 +1053,13 @@ torch.utils.cpp_extension
-
-torch.utils.cpp_extension.verify_ninja_availability()[source][source]¶
+torch.utils.cpp_extension.verify_ninja_availability()[source][source]¶
Raise RuntimeError
if ninja build system is not available on the system, does nothing otherwise.
-
-torch.utils.cpp_extension.is_ninja_available()[source][source]¶
+torch.utils.cpp_extension.is_ninja_available()[source][source]¶
Return True
if the ninja build system is available on the system, False
otherwise.
diff --git a/2.7/cuda._sanitizer.html b/2.7/cuda._sanitizer.html
index 356881c30d0..ff1c5837343 100644
--- a/2.7/cuda._sanitizer.html
+++ b/2.7/cuda._sanitizer.html
@@ -696,7 +696,7 @@ Usage
API Reference¶
-
-torch.cuda._sanitizer.enable_cuda_sanitizer()[source][source]¶
+torch.cuda._sanitizer.enable_cuda_sanitizer()[source][source]¶
Enable CUDA Sanitizer.
The sanitizer will begin to analyze low-level CUDA calls invoked by torch functions
for synchronization errors. All data races found will be printed to the standard
diff --git a/2.7/cuda.html b/2.7/cuda.html
index dddd9188f48..b1a1f0542cb 100644
--- a/2.7/cuda.html
+++ b/2.7/cuda.html
@@ -891,7 +891,7 @@
Graphs (beta)
-
-class torch.cuda.use_mem_pool(pool, device=None)[source][source]¶
+class torch.cuda.use_mem_pool(pool, device=None)[source][source]¶
A context manager that routes allocations to a given pool.
- Parameters
diff --git a/2.7/cuda.tunable.html b/2.7/cuda.tunable.html
index 7e64d0816c1..157b5ed2a55 100644
--- a/2.7/cuda.tunable.html
+++ b/2.7/cuda.tunable.html
@@ -761,7 +761,7 @@ Environment Variable Interface¶
-
-torch.cuda.tunable.enable(val=True)[source][source]¶
+torch.cuda.tunable.enable(val=True)[source][source]¶
This is the big on/off switch for all TunableOp implementations.
@@ -769,7 +769,7 @@ API Reference
-
-torch.cuda.tunable.is_enabled()[source][source]¶
+torch.cuda.tunable.is_enabled()[source][source]¶
Returns whether the TunableOp feature is enabled.
- Return type
@@ -780,7 +780,7 @@ API Reference
-
-torch.cuda.tunable.tuning_enable(val=True)[source][source]¶
+torch.cuda.tunable.tuning_enable(val=True)[source][source]¶
Enable tuning of TunableOp implementations.
When enabled, if a tuned entry isn’t found, run the tuning step and record
the entry.
@@ -790,7 +790,7 @@ API Reference
-
-torch.cuda.tunable.tuning_is_enabled()[source][source]¶
+torch.cuda.tunable.tuning_is_enabled()[source][source]¶
Returns whether TunableOp implementations can be tuned.
- Return type
@@ -801,7 +801,7 @@ API Reference
-
-torch.cuda.tunable.record_untuned_enable(val=True)[source][source]¶
+torch.cuda.tunable.record_untuned_enable(val=True)[source][source]¶
Enable recording untuned of TunableOp perations for offline tuning.
When enabled, if a tuned entry isn’t found, write it to the untuned file.
@@ -810,7 +810,7 @@ API Reference
-
-torch.cuda.tunable.record_untuned_is_enabled()[source][source]¶
+torch.cuda.tunable.record_untuned_is_enabled()[source][source]¶
Returns whether TunableOp operations are recorded for offline tuning.
- Return type
@@ -821,7 +821,7 @@ API Reference
-
-torch.cuda.tunable.set_max_tuning_duration(duration)[source][source]¶
+torch.cuda.tunable.set_max_tuning_duration(duration)[source][source]¶
Set max time in milliseconds to spend tuning a given solution.
If both max tuning duration and iterations are set, the smaller of the two
will be honored. At minimum 1 tuning iteration will always be run.
@@ -831,7 +831,7 @@ API Reference
-
-torch.cuda.tunable.get_max_tuning_duration()[source][source]¶
+torch.cuda.tunable.get_max_tuning_duration()[source][source]¶
Get max time to spend tuning a given solution.
- Return type
@@ -842,7 +842,7 @@ API Reference
-
-torch.cuda.tunable.set_max_tuning_iterations(iterations)[source][source]¶
+torch.cuda.tunable.set_max_tuning_iterations(iterations)[source][source]¶
Set max number of iterations to spend tuning a given solution.
If both max tuning duration and iterations are set, the smaller of the two
will be honored. At minimum 1 tuning iteration will always be run.
@@ -852,7 +852,7 @@ API Reference
-
-torch.cuda.tunable.get_max_tuning_iterations()[source][source]¶
+torch.cuda.tunable.get_max_tuning_iterations()[source][source]¶
Get max iterations to spend tuning a given solution.
- Return type
@@ -863,7 +863,7 @@ API Reference
-
-torch.cuda.tunable.set_filename(filename, insert_device_ordinal=False)[source][source]¶
+torch.cuda.tunable.set_filename(filename, insert_device_ordinal=False)[source][source]¶
Set the filename to use for input/output of tuning results.
If insert_device_ordinal
is True
then the current device ordinal
will be added to the given filename automatically. This can be used in a
@@ -874,7 +874,7 @@
API Reference
-
-torch.cuda.tunable.get_filename()[source][source]¶
+torch.cuda.tunable.get_filename()[source][source]¶
Get the results filename.