code: def test_can_init_cosine(self):
      legacy_attention = MatrixAttention.from_params(
          Params({"type": "cosine"})
      )
      isinstance(legacy_attention, CosineMatrixAttention)
  
file_path: allennlp/tests/modules/matrix_attention/cosine_matrix_attention_test.py
imports: import torch
  from numpy.testing import assert_almost_equal
  import numpy
  from allennlp.common import Params
  from allennlp.common.testing.test_case import AllenNlpTestCase
  from allennlp.modules.matrix_attention import CosineMatrixAttention
  from allennlp.modules.matrix_attention.matrix_attention import MatrixAttention
label_desc: Use image node_id 1 for calling the TestCosineMatrixAttention obj's underlying member method code with example usage: obj.test_can_init_cosine() without return types