multibind

torchhd.multibind(input: VSATensor) VSATensor[source]

Binding of multiple hypervectors.

Binds all the input hypervectors together.

\[\bigotimes_{i=0}^{n-1} V_i\]
Parameters:

input (VSATensor) – input hypervector tensor.

Shapes:
  • Input: \((*, n, d)\)

  • Output: \((*, d)\)

Examples:

>>> x = torchhd.random(3, 6)
>>> x
tensor([[ 1., -1.,  1., -1., -1., -1.],
        [-1., -1.,  1., -1., -1.,  1.],
        [-1., -1.,  1., -1., -1.,  1.]])
>>> torchhd.multibind(x)
tensor([ 1., -1.,  1., -1., -1., -1.])