Skip to main content

This Python module provides a collection of utility functions designed for advanced tensor manipulation using PyTorch. It includes functions for applying operations along specific dimensions, mapping values to new ranges, and generating linearly spaced tensors, among others.

Project description

PyTorch Extension

Overview

This Python module provides a collection of utility functions designed for advanced tensor manipulation using PyTorch. It includes functions for applying operations along specific dimensions, mapping values to new ranges, and generating linearly spaced tensors, among others.

Functions

buffer(tensor, persistent)

Used in the nn.Module, for registering a buffer in an assignment form.

apply_from_dim(func, tensor, dim, otypes)

Applies a given function to a specified dimension of a tensor.

min_dims(tensor, dims, keepdim, out)

Computes the minimum values over specified dimensions.

max_dims(tensor, dims, keepdim, out)

Computes the maximum values over specified dimensions.

map_range(tensor, interval, dim, dtype, scalar_default, eps)

Maps tensor values to a specified range.

map_ranges(tensor, intervals, dim=None, dtype, scalar_default, eps)

Maps tensor values to multiple specified ranges.

gamma(input, out)

Calculates the gamma function for each element in the tensor.

gamma_div(left, right, out)

Calculates the division of gamma functions for corresponding elements of two tensors.

recur_lgamma(n, base)

Calculates the recursive logarithm of the gamma function.

arith_gamma_prod(arith_term, arith_base, ratio_base)

Calculates the product of terms using the arithmetic series and gamma function.

linspace(start, stop, num, dtype)

Generates linearly spaced values between start and stop, supporting Tensor as input.

linspace_at(index, start, stop, num, dtype)

Generates linearly spaced values at specific indices.

invert(tensor)

Inverts the values in the tensor across its dimensions.

nn.refine_model(model)

Extracts the underlying model from a DataParallel wrapper, if present.

nn.Buffer(tensor, persistent)

The class that used in the buffer(tensor, persistent).

Usage

These functions are intended for use with PyTorch tensors in deep learning and numerical computation contexts. Each function provides additional control over tensor operations, particularly in high-dimensional data manipulation and preprocessing.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

torch_extension-0.0.1.3.6.tar.gz (14.7 kB view details)

Uploaded Source

Built Distribution

torch_extension-0.0.1.3.6-py3-none-any.whl (14.1 kB view details)

Uploaded Python 3

File details

Details for the file torch_extension-0.0.1.3.6.tar.gz.

File metadata

  • Download URL: torch_extension-0.0.1.3.6.tar.gz
  • Upload date:
  • Size: 14.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.10.0

File hashes

Hashes for torch_extension-0.0.1.3.6.tar.gz
Algorithm Hash digest
SHA256 3e64fb8831b7f5b2052ad0cc769640c34b146e27bc0e9649dcfd030e098ade2c
MD5 79a4045435af840d09df80d0600869cc
BLAKE2b-256 b6d874a167fb80fcb58f96c851ef4b8aec6728d318d88eb1f7e34cd301655301

See more details on using hashes here.

File details

Details for the file torch_extension-0.0.1.3.6-py3-none-any.whl.

File metadata

File hashes

Hashes for torch_extension-0.0.1.3.6-py3-none-any.whl
Algorithm Hash digest
SHA256 23c16e69a4e937eb7e67fa5c651a2e1cfe26ffc8a4094dd335ef2b170df44a4e
MD5 d09edaab7cc6e7c7ad4f971e9467cc73
BLAKE2b-256 2e8d1bbbec6c166d412688d53c62f253e3059baf5b0b0475167de38316a188a7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page