Tensor.prodOut

Tensor.prodOut(*args)

Projection using multiplication as operation.

Parameters:

varnames (str | Iterable[str]) – the set of vars to eliminate

Returns:

the projected Tensor

Return type:

pyagrum.Tensor

Raises:

pyagrum.InvalidArgument – If varnames contains only one variable that does not exist in the Tensor

Example

import pyagrum as gum

a, b = gum.LabelizedVariable("a", "a", 2), gum.LabelizedVariable("b", "b", 3)
p = gum.Tensor().add(a).add(b).fillWith([1, 2, 3, 4, 5, 6])
p.prodOut(["b"]).tolist()
# [15.0, 48.0]

Class

Tensor