id
stringlengths
16
145
text
stringlengths
1
179k
title
stringclasses
1 value
pytorch_torch_tensor_functions/pytorch_torch_tensor_functions_246_0.txt
# torch.Tensor.q_zero_point ¶ Tensor. q_zero_point ( ) → [ int ](https://docs.python.org/3/library/functions.html#int "\(in Python v3.12\)") ¶ Given a Tensor quantized by linear(affine) quantization, returns the zero_point of the underlying quantizer().
pytorch_torch_tensor_functions/pytorch_torch_tensor_functions_124_0.txt
# torch.lu ¶ torch. lu ( _ * args _ , _ ** kwargs _ ) ¶ Computes the LU factorization of a matrix or batches of matrices ` A ` . Returns a tuple containing the LU factorization and pivots of ` A ` . Pivoting is done if ` pivot ` is set to ` True ` . Warning ` torch.lu() ` is deprecated in favo...
pytorch_torch_tensor_functions/Pytorch_Documentations_47_14.txt
f set to ` True ` , will do this operation in-place. Default: ` False ` ### dropout3d ¶ ` torch.nn.functional. ` ` dropout3d ` ( _input_ , _p=0.5_ , _training=True_ , _inplace=False_ ) [ [source] ](_modules/torch/nn/functional.html#dropout3d) ¶ Randomly zero out entire channels (a channel is a 3D feature...
pytorch_torch_tensor_functions/pytorch_torch_tensor_functions_131_0.txt
# torch.frac ¶ torch. frac ( _ input _ , _ * _ , _ out = None _ ) → [ Tensor ](../tensors.html#torch.Tensor "torch.Tensor") ¶ Computes the fractional portion of each element in ` input ` . out i = input i − ⌊ ∣ input i ∣ ⌋ ∗ sgn ⁡ ( input i ) \text{out}_{i} = \text{input}_{i} - ...
pytorch_torch_tensor_functions/Pytorch_Documentations_45_2.txt
) * [ Get Started ](https://pytorch.org/get-started) * [ Features ](https://pytorch.org/features) * [ Ecosystem ](https://pytorch.org/ecosystem) * [ Mobile ](https://pytorch.org/mobile) * [ PyTorch Hub ](https://pytorch.org/hub) * [ Blog ](https://pytorch.org/blog/) * [ Tutorials ](https://pytorch.org/tu...
pytorch_torch_tensor_functions/Pytorch_Documentations_57_22.txt
` sign ` ¶ Returns the sign of the determinant of the Jacobian, if applicable. In general this only makes sense for bijective transforms. ` log_abs_det_jacobian ` ( _x_ , _y_ ) [ [source] ](_modules/torch/distributions/transforms.html#Transform.log_abs_det_jacobian) ¶ Computes the log det jacobian lo...
pytorch_torch_tensor_functions/Pytorch_Documentations_58_49.txt
SoftmaxTransform) * [ Softmin (class in torch.nn) ](generated/torch.nn.Softmin.html#torch.nn.Softmin) * [ softmin() (in module torch.nn.functional) ](nn.functional.html#torch.nn.functional.softmin) * [ Softplus (class in torch.nn) ](generated/torch.nn.Softplus.html#torch.nn.Softplus) * [ softplus() (in module t...
pytorch_torch_tensor_functions/pytorch_torch_tensor_functions_93_0.txt
# torch.Tensor.index_copy ¶ Tensor. index_copy ( _ dim _ , _ index _ , _ tensor2 _ ) → [ Tensor ](../tensors.html#torch.Tensor "torch.Tensor") ¶ Out-of-place version of [ ` torch.Tensor.index_copy_() ` ](torch.Tensor.index_copy_.html#torch.Tensor.index_copy_ "torch.Tensor.index_copy_") .
pytorch_torch_tensor_functions/Pytorch_Documentations_12_2.txt
s, require changing the creator of all inputs to the ` Function ` representing this operation. This can be tricky, especially if there are many Tensors that reference the same storage (e.g. created by indexing or transposing), and in-place functions will actually raise an error if the storage of modified inputs is ref...
pytorch_torch_tensor_functions/Pytorch_Documentations_19_0.txt
[ ](https://pytorch.org) * [ Get Started ](/get-started) * Ecosystem [ PyTorch Conference - 2024 September 18-19 in San Francisco ](https://events.linuxfoundation.org/pytorch-conference/) [ Tools Learn about the tools and frameworks in the PyTorch Ecosystem ](/ecosystem) * Edge [ About PyTorch Edge ](/e...
pytorch_torch_tensor_functions/Pytorch_Documentations_63_1.txt
orch.Tensor "torch.Tensor") . PyTorch has twelve different data types: Data type | dtype | Legacy Constructors ---|---|--- 32-bit floating point | ` torch.float32 ` or ` torch.float ` | ` torch.*.FloatTensor ` 64-bit floating point | ` torch.float64 ` or ` torch.double ` | ` torch.*.DoubleTensor ...
pytorch_torch_tensor_functions/Pytorch_Documentations_58_48.txt
g.set_sharing_strategy) * [ set_state() (torch.Generator method) ](generated/torch.Generator.html#torch.Generator.set_state) * [ set_video_backend() (in module torchvision) ](torchvision/index.html#torchvision.set_video_backend) * [ SGD (class in torch.optim) ](optim.html#torch.optim.SGD) * [ shape_as_tensor() ...
pytorch_torch_tensor_functions/Pytorch_Documentations_47_27.txt
inear , bilinear , and trilinear ) don’t proportionally align the output and input pixels, and thus the output values can depend on the input size. This was the default behavior for these modes up to version 0.3.1. Since then, the default behavior is ` align_corners = False ` . See [ ` Upsample ` ](generated/to...
pytorch_torch_tensor_functions/Pytorch_Documentations_47_24.txt
g size by which to pad some dimensions of ` input ` are described starting from the last dimension and moving forward. ⌊ len(pad) 2 ⌋ \left\lfloor\frac{\text{len(pad)}}{2}\right\rfloor ⌊ 2 len(pad) ​ ⌋ dimensions of ` input ` will be padded. For example, to pad only the last dimension of the input tensor, th...
pytorch_torch_tensor_functions/Pytorch_Documentations_49_25.txt
or ¶ In-place version of ` sub() ` ` sum ` ( _dim=None_ , _keepdim=False_ , _dtype=None_ ) → Tensor ¶ See [ ` torch.sum() ` ](generated/torch.sum.html#torch.sum "torch.sum") ` sum_to_size ` ( _*size_ ) → Tensor ¶ Sum ` this ` tensor to ` size ` . ` size ` must be broadcastable to `...
pytorch_torch_tensor_functions/Pytorch_Documentations_25_16.txt
del on a given dataloader ` loader ` at the end of training: >>> torch.optim.swa_utils.update_bn(loader, swa_model) ` update_bn() ` applies the ` swa_model ` to every element in the dataloader and computes the activation statistics for each batch normalization layer in the model. Warning ` upd...
pytorch_torch_tensor_functions/Solve_CUDA_out_of_memory_2_2.txt
size=(1, 256, 256), requires_grad=True) # Forward pass with checkpointing output = checkpoint(model, input_data) # Compute loss loss = loss_fn(output, target) # Backward pass loss.backward() * **Parameter Swapping to/from CPU during Training** : If some parameters are ...
pytorch_torch_tensor_functions/Solve_CUDA_out_of_memory_4_0.txt
## Conclusion Dealing with the ‘CUDA out of memory’ error in PyTorch is not uncommon when handling large datasets or complex models. While it can be a hindrance, understanding its core causes paves the way for efficient solutions. Adjusting the batch size, choosing smaller or more efficient model architectures, lever...
pytorch_torch_tensor_functions/pytorch_torch_tensor_functions_159_0.txt
# torch.Tensor.to_sparse_csc ¶ Tensor. to_sparse_csc ( ) → [ Tensor ](../tensors.html#torch.Tensor "torch.Tensor") ¶ Convert a tensor to compressed column storage (CSC) format. Except for strided tensors, only works with 2D tensors. If the ` self ` is strided, then the number of dense dimensions could...
pytorch_torch_tensor_functions/pytorch_torch_tensor_functions_185_0.txt
# torch.nn.functional.hardshrink ¶ torch.nn.functional. hardshrink ( _ input _ , _ lambd = 0.5 _ ) → [ Tensor ](../tensors.html#torch.Tensor "torch.Tensor") ¶ Applies the hard shrinkage function element-wise
pytorch_torch_tensor_functions/Solve_CUDA_out_of_memory_0_0.txt
[ ![](/icons/saturncloud-logo-1.svg) ](/) * __ Why Saturn Cloud * [ __ For Data Scientists ](/why-sc/data-scientists/) * [ __ For Data Science Leaders ](/why-sc/data-science-leaders/) * [ __ For Software Engineers ](/why-sc/engineers/) * [ __ Customers ](/customers/) * __ Partners * [ __ NVID...
pytorch_torch_tensor_functions/pytorch_torch_tensor_functions_303_0.txt
# torch.Tensor.baddbmm ¶ Tensor. baddbmm ( _ batch1 _ , _ batch2 _ , _ * _ , _ beta = 1 _ , _ alpha = 1 _ ) → [ Tensor ](../tensors.html#torch.Tensor "torch.Tensor") ¶
pytorch_torch_tensor_functions/pytorch_torch_tensor_functions_105_0.txt
# torch.greater ¶ torch. greater ( _ input _ , _ other _ , _ * _ , _ out = None _ ) → [ Tensor ](../tensors.html#torch.Tensor "torch.Tensor") ¶ Alias for [ ` torch.gt() ` ](torch.gt.html#torch.gt "torch.gt") .
pytorch_torch_tensor_functions/pytorch_torch_tensor_functions_69_0.txt
# torch.Tensor.greater_equal ¶ Tensor. greater_equal ( _ other _ ) → [ Tensor ](../tensors.html#torch.Tensor "torch.Tensor") ¶
pytorch_torch_tensor_functions/Pytorch_Documentations_58_44.txt
r method) ](tensors.html#torch.Tensor.reshape) * [ reshape_as() (torch.Tensor method) ](tensors.html#torch.Tensor.reshape_as) * [ Resize (class in torchvision.transforms) ](torchvision/transforms.html#torchvision.transforms.Resize) * [ resize() (in module torchvision.transforms.functional) ](torchvision/transform...
pytorch_torch_tensor_functions/Pytorch_Documentations_32_2.txt
ones(4)) __main__:1: UserWarning: self and other do not have the same shape, but are broadcastable, and have the same number of elements. Changing behavior in a backwards incompatible manner to broadcasting rather than viewing as 1-dimensional. [ Next ![](../_static/images/chevron-right-orange.svg) ](cpu_...
pytorch_torch_tensor_functions/Pytorch_Documentations_36_0.txt
[ ](https://pytorch.org/) * [ Get Started ](https://pytorch.org/get-started) * Ecosystem [ Models (Beta) Discover, publish, and reuse pre-trained models ](https://pytorch.org/hub) [ Tools & Libraries Explore the ecosystem of tools and libraries ](https://pytorch.org/ecosystem) * [ Mobile ](https://pytorch....
pytorch_torch_tensor_functions/Pytorch_Documentations_46_8.txt
ble controls: [ Cookies Policy ](https://www.facebook.com/policies/cookies/) . ![](_static/images/pytorch-x.svg) [ ](https://pytorch.org/) * [ Get Started ](https://pytorch.org/get-started) * [ Features ](https://pytorch.org/features) * [ Ecosystem ](https://pytorch.org/ecosystem) * [ Mobile ](https://pytorc...
pytorch_torch_tensor_functions/Pytorch_Documentations_62_12.txt
torch.Tensor "torch.Tensor") _]_ ) – List of tensors(on different GPUs) to be broadcast from current process. Note that ` len(input_tensor_list) ` needs to be the same for all the distributed processes calling this function. * **group** ( _ProcessGroup_ _,_ _optional_ ) – The process group to work on * **async...
pytorch_torch_tensor_functions/pytorch_torch_tensor_functions_463_0.txt
# torch.Tensor.nextafter ¶ Tensor. nextafter ( _ other _ ) → [ Tensor ](../tensors.html#torch.Tensor "torch.Tensor") ¶
pytorch_torch_tensor_functions/pytorch_torch_tensor_functions_499_0.txt
# torch.mul ¶ torch. mul ( _ input _ , _ other _ , _ * _ , _ out = None _ ) → [ Tensor ](../tensors.html#torch.Tensor "torch.Tensor") ¶ Multiplies ` input ` by ` other ` . out i = input i × other i \text{out}_i = \text{input}_i \times \text{other}_i out i ​ = input i ​ × other...
pytorch_torch_tensor_functions/pytorch_torch_tensor_functions_194_0.txt
# torch.median ¶ torch. median ( _ input _ ) → [ Tensor ](../tensors.html#torch.Tensor "torch.Tensor") ¶ Returns the median of the values in ` input ` . Note The median is not unique for ` input ` tensors with an even number of elements. In this case the lower of the two medians is returned. To co...
pytorch_torch_tensor_functions/Pytorch_Documentations_12_1.txt
write more efficient, cleaner programs, and can aid you in debugging. ## Excluding subgraphs from backward ¶ Every Tensor has a flag: ` requires_grad ` that allows for fine grained exclusion of subgraphs from gradient computation and can increase efficiency. ### ` requires_grad ` ¶ If there’s a single input t...
pytorch_torch_tensor_functions/Visualizing_PyTorch_memory_0_0.txt
[ Zach's Blog ](/) [ About ](/about/) # Visualizing PyTorch memory usage over time Dec 9, 2022 [ ![trace3](/assets/trace.png) ](/assets/trace.html) [ Memory snapshots ](https://zdevito.github.io/2022/08/16/memory- snapshots.html) are a way to dump and visualize the state of CUDA memory allocation in PyTorch. They...
pytorch_torch_tensor_functions/Pytorch_Documentations_21_0.txt
[ ](https://pytorch.org/) * [ Get Started ](https://pytorch.org/get-started) * Ecosystem [ Models (Beta) Discover, publish, and reuse pre-trained models ](https://pytorch.org/hub) [ Tools & Libraries Explore the ecosystem of tools and libraries ](https://pytorch.org/ecosystem) * [ Mobile ](https://pytorch....
pytorch_torch_tensor_functions/Pytorch_Documentations_25_6.txt
rmsprop.html#RMSprop) ¶ Implements RMSprop algorithm. Proposed by G. Hinton in his [ course ](https://www.cs.toronto.edu/~tijmen/csc321/slides/lecture_slides_lec6.pdf) . The centered version first appears in [ Generating Sequences With Recurrent Neural Networks ](https://arxiv.org/pdf/1308.0850v5.pdf) . The i...
pytorch_torch_tensor_functions/Pytorch_Documentations_25_0.txt
[ ](https://pytorch.org/) * [ Get Started ](https://pytorch.org/get-started) * Ecosystem [ Models (Beta) Discover, publish, and reuse pre-trained models ](https://pytorch.org/hub) [ Tools & Libraries Explore the ecosystem of tools and libraries ](https://pytorch.org/ecosystem) * [ Mobile ](https://pytorch....
pytorch_torch_tensor_functions/pytorch_torch_tensor_functions_433_0.txt
# torch.Tensor.digamma ¶ Tensor. digamma ( ) → [ Tensor ](../tensors.html#torch.Tensor "torch.Tensor") ¶
pytorch_torch_tensor_functions/Pytorch_Documentations_55_11.txt
#torch.BFloat16Storage) * [ ` ComplexDoubleStorage ` ](storage.html#torch.ComplexDoubleStorage) * [ ` ComplexFloatStorage ` ](storage.html#torch.ComplexFloatStorage) * [ ` QUInt8Storage ` ](storage.html#torch.QUInt8Storage) * [ ` QInt8Storage ` ](storage.html#torch.QInt8Storage) * [ ` QInt32Stor...
pytorch_torch_tensor_functions/Pytorch_Documentations_60_0.txt
[ ](https://pytorch.org/) * [ Get Started ](https://pytorch.org/get-started) * Ecosystem [ Models (Beta) Discover, publish, and reuse pre-trained models ](https://pytorch.org/hub) [ Tools & Libraries Explore the ecosystem of tools and libraries ](https://pytorch.org/ecosystem) * [ Mobile ](https://pytorch....
pytorch_torch_tensor_functions/pytorch_torch_tensor_functions_34_0.txt
# torch.negative ¶ torch. negative ( _ input _ , _ * _ , _ out = None _ ) → [ Tensor ](../tensors.html#torch.Tensor "torch.Tensor") ¶ Alias for [ ` torch.neg() ` ](torch.neg.html#torch.neg "torch.neg")
pytorch_torch_tensor_functions/pytorch_torch_tensor_functions_268_0.txt
# torch.logical_not ¶ torch. logical_not ( _ input _ , _ * _ , _ out = None _ ) → [ Tensor ](../tensors.html#torch.Tensor "torch.Tensor") ¶ Computes the element-wise logical NOT of the given input tensor. If not specified, the output tensor will have the bool dtype. If the input tensor is not a boo...
pytorch_torch_tensor_functions/Pytorch_Documentations_27_14.txt
h _GLIBCXX_USE_CXX11_ABI=1 ---|--- [ ` result_type ` ](generated/torch.result_type.html#torch.result_type "torch.result_type") | Returns the [ ` torch.dtype ` ](tensor_attributes.html#torch.torch.dtype "torch.torch.dtype") that would result from performing an arithmetic operation on the provided input tensors. ...
pytorch_torch_tensor_functions/Pytorch_Documentations_47_31.txt
## Resources Find development resources and get your questions answered [ View Resources ](https://pytorch.org/resources) [ ](https://pytorch.org/) * [ PyTorch ](https://pytorch.org/) * [ Get Started ](https://pytorch.org/get-started) * [ Features ](https://pytorch.org/features) * [ Ecosystem ](https://pyt...
pytorch_torch_tensor_functions/Memory Management_5_0.txt
# Advantages and benefits of using PYTORCH_CUDA_ALLOC_CONF: 1. **Improved performance** : PYTORCH_CUDA_ALLOC_CONF offers various memory allocation strategies to significantly enhance performance in deep learning tasks. By optimizing memory usage, it reduces memory fragmentation and improves overall memory managemen...
pytorch_torch_tensor_functions/Pytorch_Documentations_62_6.txt
_Tensor_ ](tensors.html#torch.Tensor "torch.Tensor") ) – Tensor to send. * **dst** ( [ _int_ ](https://docs.python.org/3/library/functions.html#int "\(in Python v3.8\)") ) – Destination rank. * **group** ( _ProcessGroup_ _,_ _optional_ ) – The process group to work on * **tag** ( [ _int_ ](https://docs.pyth...
pytorch_torch_tensor_functions/Pytorch_Documentations_24_5.txt
CUDA semantics ](notes/cuda.html#cuda-semantics) for details. Parameters * **device** ( [ _torch.device_ ](tensor_attributes.html#torch.torch.device "torch.torch.device") _or_ [ _int_ ](https://docs.python.org/3/library/functions.html#int "\(in Python v3.8\)") _,_ _optional_ ) – a device on which to allocate...
pytorch_torch_tensor_functions/pytorch_torch_tensor_functions_448_0.txt
# torch.gcd ¶ torch. gcd ( _ input _ , _ other _ , _ * _ , _ out = None _ ) → [ Tensor ](../tensors.html#torch.Tensor "torch.Tensor") ¶ Computes the element-wise greatest common divisor (GCD) of ` input ` and ` other ` . Both ` input ` and ` other ` must have integer types. Note This defin...
pytorch_torch_tensor_functions/pytorch_torch_tensor_functions_101_0.txt
# torch.Tensor.addcdiv ¶ Tensor. addcdiv ( _ tensor1 _ , _ tensor2 _ , _ * _ , _ value = 1 _ ) → [ Tensor ](../tensors.html#torch.Tensor "torch.Tensor") ¶
pytorch_torch_tensor_functions/pytorch_torch_tensor_functions_22_0.txt
# torch.Tensor.is_quantized ¶ Tensor. is_quantized ¶ Is ` True ` if the Tensor is quantized, ` False ` otherwise.
pytorch_torch_tensor_functions/Pytorch_Documentations_46_1.txt
a directory for visualization within the TensorBoard UI. Scalars, images, histograms, graphs, and embedding visualizations are all supported for PyTorch models and tensors as well as Caffe2 nets and blobs. The SummaryWriter class is your main entry to log data for consumption and visualization by TensorBoard. For exa...
pytorch_torch_tensor_functions/pytorch_torch_tensor_functions_318_0.txt
# torch.Tensor.arctanh ¶ Tensor. arctanh ( ) → [ Tensor ](../tensors.html#torch.Tensor "torch.Tensor") ¶
pytorch_torch_tensor_functions/Pytorch_Documentations_66_0.txt
[ ](https://pytorch.org/) * [ Get Started ](https://pytorch.org/get-started) * Ecosystem [ Models (Beta) Discover, publish, and reuse pre-trained models ](https://pytorch.org/hub) [ Tools & Libraries Explore the ecosystem of tools and libraries ](https://pytorch.org/ecosystem) * [ Mobile ](https://pytorch....
pytorch_torch_tensor_functions/Pytorch_Documentations_22_3.txt
ry header includes, as well as the (pybind11) binding code. More precisely, strings passed to ` cpp_sources ` are first concatenated into a single ` .cpp ` file. This file is then prepended with ` #include <torch/extension.h> ` . Furthermore, if the ` functions ` argument is supplied, bindings will be automatically...
pytorch_torch_tensor_functions/Memory Management_3_0.txt
# How does PYTORCH_CUDA_ALLOC_CONF work? As discussed earlier, PYTORCH_CUDA_ALLOC_CONF is a PyTorch environment variable that allows us to configure memory allocation behavior for CUDA tensors. It controls memory allocation strategies, enabling users to optimize memory usage and improve performance in deep learning t...
pytorch_torch_tensor_functions/Pytorch_Documentations_52_7.txt
` ](generated/torch.nn.SoftMarginLoss.html#torch.nn.SoftMarginLoss "torch.nn.SoftMarginLoss") | Creates a criterion that optimizes a two-class classification logistic loss between input tensor x x x and target tensor y y y (containing 1 or -1). [ ` nn.MultiLabelSoftMarginLoss ` ](generated/torch.nn.MultiLa...
pytorch_torch_tensor_functions/Pytorch_Documentations_25_1.txt
er ¶ To use ` torch.optim ` you have to construct an optimizer object, that will hold the current state and will update the parameters based on the computed gradients. ### Constructing it ¶ To construct an ` Optimizer ` you have to give it an iterable containing the parameters (all should be ` Variable ` s) ...
pytorch_torch_tensor_functions/pytorch_torch_tensor_functions_264_0.txt
# torch.topk ¶ torch. topk ( _ input _ , _ k _ , _ dim = None _ , _ largest = True _ , _ sorted = True _ , _ * _ , _ out = None _ ) ¶ Returns the ` k ` largest elements of the given ` input ` tensor along a given dimension. If ` dim ` is not given, the last dimension of the input is c...
pytorch_torch_tensor_functions/pytorch_torch_tensor_functions_389_0.txt
# torch.Tensor.sparse_mask ¶ Tensor. sparse_mask ( _ mask _ ) → [ Tensor ](../tensors.html#torch.Tensor "torch.Tensor") ¶ Returns a new [ sparse tensor ](../sparse.html#sparse-docs) with values from a strided tensor ` self ` filtered by the indices of the sparse tensor ` mask ` . The values of ` mask...
pytorch_torch_tensor_functions/Pytorch_Documentations_49_20.txt
generated/numpy.tile.html) . For the operator similar to numpy.repeat , see [ ` torch.repeat_interleave() ` ](generated/torch.repeat_interleave.html#torch.repeat_interleave "torch.repeat_interleave") . Parameters **sizes** ( _torch.Size_ _or_ _int..._ ) – The number of times to repeat this tensor along each ...
pytorch_torch_tensor_functions/pytorch_torch_tensor_functions_420_0.txt
# torch.Tensor.cauchy_ ¶ Tensor. cauchy_ ( _ median = 0 _ , _ sigma = 1 _ , _ * _ , _ generator = None _ ) → [ Tensor ](../tensors.html#torch.Tensor "torch.Tensor") ¶ Fills the tensor with numbers drawn from the Cauchy distribution: f ( x ) = 1 π σ ( x − median ) 2 \+ σ 2 f(...
pytorch_torch_tensor_functions/Pytorch_Documentations_7_20.txt
` ` max_pool2d ` ( _input_ , _kernel_size_ , _stride=None_ , _padding=0_ , _dilation=1_ , _ceil_mode=False_ , _return_indices=False_ ) [ [source] ](_modules/torch/nn/quantized/functional.html#max_pool2d) ¶ Applies a 2D max pooling over a quantized input signal composed of several quantized input planes. Note...
pytorch_torch_tensor_functions/pytorch_torch_tensor_functions_373_0.txt
# torch.Tensor.gcd ¶ Tensor. gcd ( _ other _ ) → [ Tensor ](../tensors.html#torch.Tensor "torch.Tensor") ¶
pytorch_torch_tensor_functions/pytorch_torch_tensor_functions_119_0.txt
# torch.unflatten ¶ torch. unflatten ( _ input _ , _ dim _ , _ sizes _ ) → [ Tensor ](../tensors.html#torch.Tensor "torch.Tensor") ¶ Expands a dimension of the input tensor over multiple dimensions.
pytorch_torch_tensor_functions/Pytorch_Documentations_60_4.txt
ml#torch.futures.Future "torch.futures.Future") object that can be waited on. When completed, the return value of ` func ` on ` args ` and ` kwargs ` can be retrieved from the [ ` Future ` ](futures.html#torch.futures.Future "torch.futures.Future") object. Warning Using GPU tensors as arguments or return values o...
pytorch_torch_tensor_functions/Pytorch_Documentations_65_4.txt
pytorch.org/mobile) * [ PyTorch Hub ](https://pytorch.org/hub) * [ Blog ](https://pytorch.org/blog/) * [ Tutorials ](https://pytorch.org/tutorials) * [ Docs ](https://pytorch.org/docs/stable/index.html) * [ Resources ](https://pytorch.org/resources) * [ Github ](https://github.com/pytorch/pytorch)
pytorch_torch_tensor_functions/pytorch_torch_tensor_functions_510_0.txt
# torch.Tensor.new_full ¶ Tensor. new_full ( _ size _ , _ fill_value _ , _ * _ , _ dtype = None _ , _ device = None _ , _ requires_grad = False _ , _ layout = torch.strided _ , _ pin_memory = False _ ) → [ Tensor ](../tensors.html#torch.Tensor "torch.Tensor") ¶ Returns a Tensor of size [...
pytorch_torch_tensor_functions/Pytorch_Documentations_58_59.txt
(class in torch.nn) ](generated/torch.nn.ZeroPad2d.html#torch.nn.ZeroPad2d) * [ zeros() (in module torch) ](generated/torch.zeros.html#torch.zeros) * [ zeros_() (in module torch.nn.init) ](nn.init.html#torch.nn.init.zeros_) * [ zeros_like() (in module torch) ](generated/torch.zeros_like.html#torch.zeros_like) ...
pytorch_torch_tensor_functions/Pytorch_Documentations_49_10.txt
diagflat() ` ](generated/torch.diagflat.html#torch.diagflat "torch.diagflat") ` diagonal ` ( _offset=0_ , _dim1=0_ , _dim2=1_ ) → Tensor ¶ See [ ` torch.diagonal() ` ](generated/torch.diagonal.html#torch.diagonal "torch.diagonal") ` fill_diagonal_ ` ( _fill_value_ , _wrap=False_ ) → Tensor ¶ Fil...
pytorch_torch_tensor_functions/pytorch_torch_tensor_functions_68_0.txt
# torch.trace ¶ torch. trace ( _ input _ ) → [ Tensor ](../tensors.html#torch.Tensor "torch.Tensor") ¶ Returns the sum of the elements of the diagonal of the input 2-D matrix. Example: >>> x = torch.arange(1., 10.).view(3, 3) >>> x tensor([[ 1., 2., 3.], [ 4., 5....
pytorch_torch_tensor_functions/Solve_CUDA_out_of_memory_1_0.txt
## What Causes ‘CUDA out of memory’ in PyTorch? You might encounter the ‘CUDA out of memory’ error in PyTorch for several reasons. Some of the most common causes include: 1. **Large batch sizes** : One of the most common causes of this error is trying to train your model with a batch size that’s too large. When yo...
pytorch_torch_tensor_functions/pytorch_torch_tensor_functions_53_0.txt
# torch.igamma ¶ torch. igamma ( _ input _ , _ other _ , _ * _ , _ out = None _ ) → [ Tensor ](../tensors.html#torch.Tensor "torch.Tensor") ¶ Alias for [ ` torch.special.gammainc() ` ](../special.html#torch.special.gammainc "torch.special.gammainc") .
pytorch_torch_tensor_functions/pytorch_torch_tensor_functions_174_0.txt
# torch.Tensor.storage ¶ Tensor. storage ( ) → [ torch.TypedStorage ](../storage.html#torch.TypedStorage "torch.TypedStorage") [ [source] ](../_modules/torch/_tensor.html#Tensor.storage) ¶ Returns the underlying [ ` TypedStorage ` ](../storage.html#torch.TypedStorage "torch.TypedStorage") . Warning [...
pytorch_torch_tensor_functions/Pytorch_Documentations_27_3.txt
her") | Gathers values along an axis specified by dim . [ ` index_select ` ](generated/torch.index_select.html#torch.index_select "torch.index_select") | Returns a new tensor which indexes the ` input ` tensor along dimension ` dim ` using the entries in ` index ` which is a LongTensor . [ ` masked_sele...
pytorch_torch_tensor_functions/pytorch_torch_tensor_functions_384_0.txt
# torch.Tensor.lerp ¶ Tensor. lerp ( _ end _ , _ weight _ ) → [ Tensor ](../tensors.html#torch.Tensor "torch.Tensor") ¶
pytorch_torch_tensor_functions/pytorch_torch_tensor_functions_212_0.txt
# torch.Tensor.view_as ¶ Tensor. view_as ( _ other _ ) → [ Tensor ](../tensors.html#torch.Tensor "torch.Tensor") ¶ View this tensor as the same size as ` other ` . ` self.view_as(other) ` is equivalent to ` self.view(other.size()) ` . Please see [ ` view() ` ](torch.Tensor.view.html#torch.Tensor....
pytorch_torch_tensor_functions/pytorch_torch_tensor_functions_210_0.txt
# torch.divide ¶ torch. divide ( _ input _ , _ other _ , _ * _ , _ rounding_mode = None _ , _ out = None _ ) → [ Tensor ](../tensors.html#torch.Tensor "torch.Tensor") ¶ Alias for [ ` torch.div() ` ](torch.div.html#torch.div "torch.div") .
pytorch_torch_tensor_functions/pytorch_torch_tensor_functions_516_0.txt
# torch.true_divide ¶ torch. true_divide ( _ dividend _ , _ divisor _ , _ * _ , _ out _ ) → [ Tensor ](../tensors.html#torch.Tensor "torch.Tensor") ¶ Alias for [ ` torch.div() ` ](torch.div.html#torch.div "torch.div") with ` rounding_mode=None ` .
pytorch_torch_tensor_functions/Pytorch_Documentations_62_9.txt
list = output >>> for i in range(world_size): >>> dist.scatter(gather_list[i], scatter_list if i == rank else [], src = i) >>> input tensor([0, 1, 2, 3, 4, 5]) # Rank 0 tensor([10, 11, 12, 13, 14, 15, 16, 17, 18]) # Rank 1 ...
pytorch_torch_tensor_functions/Pytorch_Documentations_29_1.txt
y in. Parameters * **devices** ( _iterable of CUDA IDs_ ) – CUDA devices for which to fork the RNG. CPU RNG state is always forked. By default, ` fork_rng() ` operates on all devices, but will emit a warning if your machine has a lot of devices, since this function will run very slowly in that case. If you ...
pytorch_torch_tensor_functions/pytorch_torch_tensor_functions_243_0.txt
# torch.take_along_dim ¶ torch. take_along_dim ( _ input _ , _ indices _ , _ dim = None _ , _ * _ , _ out = None _ ) → [ Tensor ](../tensors.html#torch.Tensor "torch.Tensor") ¶ Selects values from ` input ` at the 1-dimensional indices from ` indices ` along the given ` dim ` . If ` dim ` ...
pytorch_torch_tensor_functions/pytorch_torch_tensor_functions_63_0.txt
# torch.logical_xor ¶ torch. logical_xor ( _ input _ , _ other _ , _ * _ , _ out = None _ ) → [ Tensor ](../tensors.html#torch.Tensor "torch.Tensor") ¶ Computes the element-wise logical XOR of the given input tensors. Zeros are treated as ` False ` and nonzeros are treated as ` True ` . Paramet...
pytorch_torch_tensor_functions/Pytorch_Documentations_7_3.txt
f quantization parameters and all integer elements are the same * [ ` int_repr() ` ](tensors.html#torch.Tensor.int_repr "torch.Tensor.int_repr") — Prints the underlying integer representation of the quantized tensor * [ ` max() ` ](tensors.html#torch.Tensor.max "torch.Tensor.max") — Returns the maximum value ...
pytorch_torch_tensor_functions/pytorch_torch_tensor_functions_140_0.txt
# torch.positive ¶ torch. positive ( _ input _ ) → [ Tensor ](../tensors.html#torch.Tensor "torch.Tensor") ¶ Returns ` input ` . Throws a runtime error if ` input ` is a bool tensor. Parameters **input** ( [ _Tensor_ ](../tensors.html#torch.Tensor "torch.Tensor") ) – the input tensor. Examp...
pytorch_torch_tensor_functions/pytorch_torch_tensor_functions_346_0.txt
# torch.Tensor.matrix_power ¶ Tensor. matrix_power ( _ n _ ) → [ Tensor ](../tensors.html#torch.Tensor "torch.Tensor") ¶ Note ` matrix_power() ` is deprecated, use [ ` torch.linalg.matrix_power() ` ](torch.linalg.matrix_power.html#torch.linalg.matrix_power "torch.linalg.matrix_power") instead. Alia...
pytorch_torch_tensor_functions/Pytorch_Documentations_44_3.txt
fan_out' ` preserves the magnitudes in the backwards pass. * **nonlinearity** – the non-linear function ( nn.functional name), recommended to use only with ` 'relu' ` or ` 'leaky_relu' ` (default). Examples >>> w = torch.empty(3, 5) >>> nn.init.kaiming_normal_(w, mode='fan_out', nonlineari...
pytorch_torch_tensor_functions/pytorch_torch_tensor_functions_360_0.txt
# torch.qr ¶ torch. qr ( _ input _ , _ some = True _ , _ * _ , _ out = None _ ) ¶ Computes the QR decomposition of a matrix or a batch of matrices ` input ` , and returns a namedtuple (Q, R) of tensors such that input = Q R \text{input} = Q R input = QR with Q Q Q being an orthogonal ...
pytorch_torch_tensor_functions/pytorch_torch_tensor_functions_26_0.txt
# torch.Tensor.is_meta ¶ Tensor. is_meta ¶ Is ` True ` if the Tensor is a meta tensor, ` False ` otherwise. Meta tensors are like normal tensors, but they carry no data.
pytorch_torch_tensor_functions/pytorch_torch_tensor_functions_375_0.txt
# torch.flip ¶ torch. flip ( _ input _ , _ dims _ ) → [ Tensor ](../tensors.html#torch.Tensor "torch.Tensor") ¶ Reverse the order of an n-D tensor along given axis in dims. Note torch.flip makes a copy of ` input ` ’s data. This is different from NumPy’s np.flip , which returns a view in constant...
pytorch_torch_tensor_functions/pytorch_torch_tensor_functions_164_0.txt
# torch.atan2 ¶ torch. atan2 ( _ input _ , _ other _ , _ * _ , _ out = None _ ) → [ Tensor ](../tensors.html#torch.Tensor "torch.Tensor") ¶ Element-wise arctangent of input i / other i \text{input}_{i} / \text{other}_{i} input i ​ / other i ​ with consideration of the quadrant. Retu...
pytorch_torch_tensor_functions/Pytorch_Documentations_48_9.txt
X file itself. These external binary files are stored in the same location as the ONNX file. Argument ‘f’ must be a string specifying the location of the model. model = torchvision.models.mobilenet_v2(pretrained=True) input = torch.randn(2, 3, 224, 224, requires_grad=True) torch.onnx.export(model...
pytorch_torch_tensor_functions/Pytorch_Documentations_49_26.txt
tensor([[-0.5044, 0.0005], [ 0.3310, -0.0584]], dtype=torch.float64, device='cuda:0') >>> other = torch.randn((), dtype=torch.float64, device=cuda0) >>> tensor.to(other, non_blocking=True) tensor([[-0.5044, 0.0005], [ 0.3310, -0.0584]], dtype=torch.float64, device='cuda:0...
pytorch_torch_tensor_functions/pytorch_torch_tensor_functions_117_0.txt
# torch.isnan ¶ torch. isnan ( _ input _ ) → [ Tensor ](../tensors.html#torch.Tensor "torch.Tensor") ¶ Returns a new tensor with boolean elements representing if each element of ` input ` is NaN or not. Complex values are considered NaN when either their real and/or imaginary part is NaN. Parameters...
pytorch_torch_tensor_functions/Pytorch_Documentations_55_12.txt
load_url() ` ](model_zoo.html#torch.utils.model_zoo.load_url) * [ torch.utils.tensorboard ](tensorboard.html) * [ ` SummaryWriter ` ](tensorboard.html#torch.utils.tensorboard.writer.SummaryWriter) * [ Type Info ](type_info.html) * [ torch.finfo ](type_info.html#torch-finfo) * [ torch.iinfo ](type_inf...
pytorch_torch_tensor_functions/pytorch_torch_tensor_functions_135_0.txt
# torch.Tensor.is_signed ¶ Tensor. is_signed ( ) → [ bool ](https://docs.python.org/3/library/functions.html#bool "\(in Python v3.12\)") ¶ Returns True if the data type of ` self ` is a signed data type.
pytorch_torch_tensor_functions/Pytorch_Documentations_58_5.txt
ute) ](distributions.html#torch.distributions.half_normal.HalfNormal.arg_constraints) * [ (torch.distributions.independent.Independent attribute) ](distributions.html#torch.distributions.independent.Independent.arg_constraints) * [ (torch.distributions.laplace.Laplace attribute) ](distributions.html#torch.distr...
pytorch_torch_tensor_functions/Pytorch_Documentations_66_2.txt
: ` OMP_NUM_THREADS ` and ` MKL_NUM_THREADS ` For the intra-op parallelism settings, ` at::set_num_threads ` , ` torch.set_num_threads ` always take precedence over environment variables, ` MKL_NUM_THREADS ` variable takes precedence over ` OMP_NUM_THREADS ` . ## Tuning the number of threads ¶ The follow...
pytorch_torch_tensor_functions/pytorch_torch_tensor_functions_365_0.txt
# torch.arctanh ¶ torch. arctanh ( _ input _ , _ * _ , _ out = None _ ) → [ Tensor ](../tensors.html#torch.Tensor "torch.Tensor") ¶ Alias for [ ` torch.atanh() ` ](torch.atanh.html#torch.atanh "torch.atanh") .
pytorch_torch_tensor_functions/Pytorch_Documentations_37_4.txt
_inputs_ , _v=None_ , _create_graph=False_ , _strict=False_ ) [ [source] ](_modules/torch/autograd/functional.html#vjp) ¶ Function that computes the dot product between a vector ` v ` and the Jacobian of the given function at the point given by the inputs. Parameters * **func** ( _function_ ) – a Py...
pytorch_torch_tensor_functions/pytorch_torch_tensor_functions_331_0.txt
# torch.sinh ¶ torch. sinh ( _ input _ , _ * _ , _ out = None _ ) → [ Tensor ](../tensors.html#torch.Tensor "torch.Tensor") ¶ Returns a new tensor with the hyperbolic sine of the elements of ` input ` . out i = sinh ⁡ ( input i ) \text{out}_{i} = \sinh(\text{input}_{i}) out i ​ = sin...