code: def allocate_peer_tensors(self, shape, dtype, channels_last, dynamic):
      nels = np.prod(shape)
      if dtype == torch.float16:
          elem_size = 2
          if dynamic:
              start = (
                  (self.dynamic_offset + self.alignment - 1)
                  // self.alignment
              ) * self.alignment
              self.dynamic_offset = start + nels * elem_size
              assert (
                  self.dynamic_offset < self.dynamic_size
              ), "Dynamic peer memory pool exhausted"
              return [
                  pm.blob_view_half(
                      pr + self.static_size + start,
                      shape,
                      channels_last,
                  )
                  for pr in self.peer_raw
              ]
          else:
              start = (
                  (self.static_offset + self.alignment - 1)
                  // self.alignment
              ) * self.alignment
              self.static_offset = start + nels * elem_size
              assert (
                  self.static_offset < self.static_size
              ), "Static peer memory pool exhausted"
              return [
                  pm.blob_view_half(pr + start, shape, channels_last)
                  for pr in self.peer_raw
              ]
      if dtype == torch.float32:
          elem_size = 4
          if dynamic:
              start = (
                  (self.dynamic_offset + self.alignment - 1)
                  // self.alignment
              ) * self.alignment
              self.dynamic_offset = start + nels * elem_size
              assert (
                  self.dynamic_offset < self.dynamic_size
              ), "Dynamic peer memory pool exhausted"
              return [
                  pm.blob_view_float(
                      pr + self.static_size + start,
                      shape,
                      channels_last,
                  )
                  for pr in self.peer_raw
              ]
          else:
              start = (
                  (self.static_offset + self.alignment - 1)
                  // self.alignment
              ) * self.alignment
              self.static_offset = start + nels * elem_size
              assert (
                  self.static_offset < self.static_size
              ), "Static peer memory pool exhausted"
              return [
                  pm.blob_view_float(pr + start, shape, channels_last)
                  for pr in self.peer_raw
              ]
      if dtype == torch.int32:
          elem_size = 4
          if dynamic:
              start = (
                  (self.dynamic_offset + self.alignment - 1)
                  // self.alignment
              ) * self.alignment
              self.dynamic_offset = start + nels * elem_size
              assert (
                  self.dynamic_offset < self.dynamic_size
              ), "Dynamic peer memory pool exhausted"
              return [
                  pm.blob_view_int(
                      pr + self.static_size + start,
                      shape,
                      channels_last,
                  )
                  for pr in self.peer_raw
              ]
          else:
              start = (
                  (self.static_offset + self.alignment - 1)
                  // self.alignment
              ) * self.alignment
              self.static_offset = start + nels * elem_size
              assert (
                  self.static_offset < self.static_size
              ), "Static peer memory pool exhausted"
              return [
                  pm.blob_view_int(pr + start, shape, channels_last)
                  for pr in self.peer_raw
              ]
      else:
          assert False, "dtype %s not supported" % (str(dtype))
  
file_path: apex/apex/contrib/peer_memory/peer_memory.py
imports: import torch
  import numpy
  import peer_memory_cuda
label_desc: Use image node_id 4 for calling the PeerMemoryPool obj's underlying member method code with example usage: obj.allocate_peer_tensors(shape, dtype, channels_last, dynamic) and returns: unknown, unknown, unknown, unknown, unknown, unknown