Variable#

class deeplay.shapes.Variable(func=None)#

Bases: object

Represents a variable integer value that can be operated on.

This class is used to represent a variable integer value that can be operated on. This is used inside shape expressions to represent the shape of the tensor that is not fully known.

Parameters#

funcCallable[[int], int], optional

The function that operates on the variable, by default None. Should usually not be set.

Returns#

int

The result of the operation on the variable.

Examples#

>>> x = Variable()
>>> y = x + 1
>>> y(1)
2
>>> y(2)
3

Methods Summary

__call__(x)

Call self as a function.

Methods Documentation

__call__(x: int) int#

Call self as a function.