calipy.tensor
This module provides basic dimension aware tensor functionality needed for subsampling, indexing, attaching dimensions to tensors and other quality of life features that allow tensors to keep and communicate extra structure.
- The classes and functions are
- CalipyIndex: Class of objects that can be used to index normal torch.tensors
and CalipyTensors or CalipyDistributions. Contains indextensors, tuples, dims, names of the elements in the tensor and functionality for reducing and expanding indices.
- CalipyIndexer: Abstract class of objects that forms the basis for TensorIndexer
and DistributionIndexer and bundles indexing methods and attributes used by both of these classes.
- TensorIndexer: Class responsible for indexing tensors. Is attached directly
to CalipyTensors and takes over active duties like subsampling, keeping track of the origin of subsampled data, and creating CalipyIndex objects based on user demands.
The TensorIndexer and CalipyIndex classes provide basic functionality that is used regularly in the context of defining basic effects and enabling primitives that need to implement subsampling (like sampling or calling parameters.)
The script is meant solely for educational and illustrative purposes. Written by Dr. Jemil Avers Butt, Atlas optimization GmbH, www.atlasoptimization.com.
Functions
|
Check if DimTuples |
|
Builds a minimal supersequence of dimension names that contains seq1 and seq2 as subsequences in the same relative order. |
|
Recursively preprocesses and unwraps input arguments and keyword arguments by replacing any nested CalipyTensor objects with their underlying torch.Tensor instances. |
Classes
|
Class acting as a collection of infos on a specific index tensor collecting basic index_tensor, index_tensor_tuple, and index_tensor_named. |
|
Base class of an Indexer that implements methods for assigning dimensions to specific slices of e.g. |
|
Class that wraps torch.Tensor objects and augments them with indexing operations and dimension upkeep functionality, while referring most torch functions to its wrapped torch. |
|
Class to handle indexing operations for CalipyIO objects, including creating local and global indices, managing subsampling, and generating named dictionaries for indexing purposes. |
|
Class to handle indexing operations for observations, including creating local and global indices, managing subsampling, and generating named dictionaries for indexing purposes. |