code: def test_torch_based_feature_repr(in_memory):
      with tempfile.TemporaryDirectory() as test_dir:
          a = torch.tensor([[1, 2, 3], [4, 5, 6]])
          b = torch.tensor([[[1, 2], [3, 4]], [[4, 5], [6, 7]]])
          metadata = {"max_value": 3}
          if not in_memory:
              a = to_on_disk_tensor(test_dir, "a", a)
              b = to_on_disk_tensor(test_dir, "b", b)
  
          feature_a = gb.TorchBasedFeature(a, metadata=metadata)
          feature_b = gb.TorchBasedFeature(b)
  
          expected_str_feature_a = (
              "TorchBasedFeature(\n"
              "    feature=tensor([[1, 2, 3],\n"
              "                    [4, 5, 6]]),\n"
              "    metadata={'max_value': 3},\n"
              ")"
          )
          expected_str_feature_b = (
              "TorchBasedFeature(\n"
              "    feature=tensor([[[1, 2],\n"
              "                     [3, 4]],\n"
              "\n"
              "                    [[4, 5],\n"
              "                     [6, 7]]]),\n"
              "    metadata={},\n"
              ")"
          )
  
          assert repr(feature_a) == expected_str_feature_a, feature_a
          assert repr(feature_b) == expected_str_feature_b, feature_b
  
          a = b = metadata = None
          feature_a = feature_b = None
          expected_str_feature_a = expected_str_feature_b = None
  
imports: import os
  import tempfile
  import unittest
  from functools import reduce
  from operator import mul
  import backend
  import numpy
  import pydantic
  import pytest
  import torch
  from dgl import graphbolt
label_desc: Use image node_id 10 for calling a global function with example usage: test_torch_based_feature_repr(in_memory) without return types