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 nn.Module, for registering a buffer in a 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 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.2.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

torch_extension-0.0.1.2-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: torch_extension-0.0.1.2.tar.gz
  • Upload date:
  • Size: 9.2 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.2.tar.gz
Algorithm Hash digest
SHA256 f6fe6d565e070dc1dac54270b508ff5b1cf1574d4502b7e8c6d73d3b6a516046
MD5 b1687e768ea9577c1b15e01dbd063c06
BLAKE2b-256 409ea9b8fc6d84bc0bfe075dd2159416d7e20a4aac9e141b962c8484b73caf64

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for torch_extension-0.0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ff70d7ff76145cd5ec76be96c6b20c655cbc1ff2a2ae06688f2a6adba20942ac
MD5 3bfc69c4092eb110a2d783370bdaabca
BLAKE2b-256 58c060cc01c1eeb640e8e65a432b1e0abac5399aca10c41d93f45cd4cce4a832

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