Tensor.putFirst

Tensor.putFirst(varname)
Parameters:
Returns:

a reference to the modified tensor

Return type:

pyagrum.Tensor

Raises:

pyagrum.InvalidArgument – If the var is not 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.names
# ('a', 'b')
p.putFirst("b").names
# ('b', 'a')

Class

Tensor