code: def test_init_works_when_input_buffer_is_shared_and_is_of_type_float(
      self,
  ) -> None:
      arr = array("f", [0.2, 0.4, 0.6])
  
      block = MemoryBlock(arr)
  
      del arr
  
      view = memoryview(block)  # type: ignore[arg-type]
  
      assert view.itemsize == 1
      assert view.ndim == 1
      assert view.shape == (12,)
      assert view.strides == (1,)
  
      view = view.cast("f")
  
      assert view.tolist() == pytest.approx([0.2, 0.4, 0.6])
  
file_path: fairseq2/tests/unit/test_memory.py
imports: import pickle
  from array import array
  import pytest
  from fairseq2.memory import MemoryBlock
label_desc: Use image node_id 2 for calling the TestMemoryBlock obj's underlying member method code with example usage: obj.test_init_works_when_input_buffer_is_shared_and_is_of_type_float() without return types