Value

class madspace.Value(*args, **kwargs)

Bases: pybind11_object

A node in a compute graph: a typed tensor that is either a literal constant or a reference to a graph local.

FunctionBuilder methods take and return Value``s. A value with ``local_index >= 0 refers to the output of an earlier instruction. Otherwise literal_value holds an inline scalar or dense tensor constant. Scalars and nested std::vector``s convert to a ``Value implicitly.

Overloaded function.

  1. __init__(self: madspace._madspace_py.Value, value: typing.SupportsInt) -> None

Scalar integer constant.

  1. __init__(self: madspace._madspace_py.Value, value: typing.SupportsFloat) -> None

Scalar floating-point constant.

  1. __init__(self: madspace._madspace_py.Value, values: collections.abc.Sequence[typing.SupportsInt], shape: collections.abc.Sequence[typing.SupportsInt] = []) -> None

  2. __init__(self: madspace._madspace_py.Value, values: collections.abc.Sequence[typing.SupportsFloat], shape: collections.abc.Sequence[typing.SupportsInt] = []) -> None

property literal_value

Inline constant, or std::monostate for a graph local.

property local_index

Index of the referenced graph local, or -1 for a literal.

property type

Type of the value.