code: def test_attri2vec_constructor():
      attri2vec = Attri2Vec(
          layer_sizes=[4],
          input_dim=2,
          node_num=4,
          multiplicity=2,
          normalize="l2",
      )
      assert attri2vec.dims == [2, 4]
      assert attri2vec.input_node_num == 4
      assert attri2vec.n_layers == 1
      assert attri2vec.bias == False
  
      # Check incorrect activation flag
      with pytest.raises(ValueError):
          Attri2Vec(
              layer_sizes=[4],
              input_dim=2,
              node_num=4,
              multiplicity=2,
              activation="unknown",
          )
  
      # Check incorrect normalization flag
      with pytest.raises(ValueError):
          Attri2Vec(
              layer_sizes=[4],
              input_dim=2,
              node_num=4,
              multiplicity=2,
              normalize=lambda x: x,
          )
  
      with pytest.raises(ValueError):
          Attri2Vec(
              layer_sizes=[4],
              input_dim=2,
              node_num=4,
              multiplicity=2,
              normalize="unknown",
          )
  
      # Check requirement for generator or input_dim and node_num & multiplicity
      with pytest.raises(ValueError):
          Attri2Vec(layer_sizes=[4])
  
      # Construction from generator
      G = example_graph(feature_size=3)
      gen = Attri2VecNodeGenerator(G, batch_size=2)
      attri2vec = Attri2Vec(
          layer_sizes=[4, 8], generator=gen, bias=True
      )
  
      assert attri2vec.dims == [3, 4, 8]
      assert attri2vec.input_node_num == 4
      assert attri2vec.n_layers == 2
      assert attri2vec.bias
  
file_path: stellargraph/tests/layer/test_attri2vec.py
imports: from stellargraph.core.graph import StellarGraph
  from stellargraph.mapper import Attri2VecNodeGenerator
  from stellargraph.layer.attri2vec import *
  from tensorflow import keras
  import numpy
  import networkx
  import pytest
  from ..test_utils.graphs import example_graph
  from ..None import test_utils
label_desc: Use image node_id 1 for calling a global function with example usage: test_attri2vec_constructor() without return types