class_docstr: Tests for random-walk positional encoding.
class_docstr_tok: ["Tests","for","random-walk","positional","encoding","."]
docstr: Test some invariances.
docstr_tok: ["Test","some","invariances","."]
code: def test_invariances(self):
      """Test some invariances."""
      self.initializer: pykeen.nn.init.PretrainedInitializer
      x = self.initializer.tensor
      # value range
      assert (x >= 0).all()
      assert (x <= 1).all()
      # highest degree node has largest value
      uniq, counts = self.triples_factory.mapped_triples[
          :, 0::2
      ].unique(return_counts=True)
      center = uniq[counts.argmax()]
      assert (x.argmax(dim=0) == center).all()
  
imports: from typing import ClassVar
  import torch
  from class_resolver import HintOrType
  import pykeen.nn.init
  from pykeen.datasets import Nations
  from pykeen.nn.modules import ComplExInteraction, Interaction, QuatEInteraction
  from tests import cases
  from ..utils import needs_packages
label_desc: Use image node_id 2 for calling the RandomWalkPositionalEncodingInitializerTestCase obj's underlying member method code with example usage: obj.test_invariances() without return types