concepts.dsl.tensor_value.TensorizedPyObjValues#

class TensorizedPyObjValues[source]#

Bases: object

A value object with nested lists of Python objects. Note that this implies that we can not use list as the Python object type when shape is not specified.

Methods

clone([deep_copy])

Recursively clone the values.

expand(target_size)

fast_index(arguments)

fast_set_index(arguments, value)

item()

make_empty(dtype, shape)

numel()

permute(indices)

Permute the axes in the nested list of values.

unsqueeze(dim)

Attributes

__getitem__(item)[source]#
__init__(dtype, values, shape=None)[source]#
Parameters:
__new__(**kwargs)#
clone(deep_copy=False)[source]#

Recursively clone the values.

Parameters:

deep_copy (bool)

expand(target_size)[source]#
Parameters:

target_size (Tuple[int, ...])

fast_index(arguments)[source]#
Parameters:

arguments (Tuple[int, ...])

fast_set_index(arguments, value)[source]#
Parameters:

arguments (Tuple[int, ...])

item()[source]#
classmethod make_empty(dtype, shape)[source]#
Parameters:
numel()[source]#
Return type:

int

permute(indices)[source]#

Permute the axes in the nested list of values.

Parameters:

indices (Tuple[int, ...])

unsqueeze(dim)[source]#
Parameters:

dim (int)

property ndim#