code: def test_scalar_mix_trainable_with_initial_scalar_parameters(self):
      initial_scalar_parameters = [1.0, 2.0, 3.0]
      mixture = ScalarMix(
          3,
          initial_scalar_parameters=initial_scalar_parameters,
          trainable=False,
      )
      for i, scalar_mix_parameter in enumerate(
          mixture.scalar_parameters
      ):
          assert scalar_mix_parameter.requires_grad is False
          assert (
              scalar_mix_parameter.item()
              == initial_scalar_parameters[i]
          )
  
file_path: allennlp/tests/modules/scalar_mix_test.py
imports: import torch
  import pytest
  import numpy
  from allennlp.common.testing import AllenNlpTestCase
  from allennlp.common.checks import ConfigurationError
  from allennlp.modules import ScalarMix
  from allennlp.nn import util
label_desc: Use image node_id 4 for calling the TestScalarMix obj's underlying member method code with example usage: obj.test_scalar_mix_trainable_with_initial_scalar_parameters() without return types