code: def test_composite_op(self, input_shape):
      _set_torch_reg_op("cosine_similarity", custom_cosine_similarity)
      model = nn.CosineSimilarity(dim=1, eps=1e-6)
      self.run_compare_torch([input_shape, input_shape], model)
      _set_torch_reg_op("cosine_similarity", default_cosine_similarity)
  
file_path: coremltools/coremltools/converters/mil/frontend/torch/test/test_custom_ops.py
imports: import pytest
  import torch
  import torch.nn
  from coremltools.converters.mil.frontend.torch.ops import _get_inputs
  from coremltools.converters.mil.frontend.torch.ops import cosine_similarity
  from coremltools.converters.mil.frontend.torch.torch_op_registry import _TORCH_OPS_REGISTRY
  from coremltools.converters.mil.frontend.torch.torch_op_registry import register_torch_op
  from coremltools.converters.mil.mil import Builder
  from coremltools.converters.mil.mil import Operation, types
  from coremltools.converters.mil.mil.input_type import DefaultInputs, InputSpec, TensorInputType
  from coremltools.converters.mil.mil.ops.defs._op_reqs import register_op
  from .testing_utils import TorchBaseTest, convert_to_mlmodel
label_desc: Use image node_id 1 for calling the TestCompositeOp obj's underlying member method code with example usage: obj.test_composite_op(input_shape) without return types