code: def draw_patches(self, plist):
      assert self.nr_row * self.nr_col >= len(
          plist
      ), "{}*{} < {}".format(self.nr_row, self.nr_col, len(plist))
      if self.channel == 3 and plist.shape[3] == 1:
          plist = np.repeat(plist, 3, axis=3)
      cur_row, cur_col = 0, 0
      if self.channel == 1:
          self.canvas.fill(self.bgcolor)
      else:
          self.canvas[:, :, :] = self.bgcolor
      for patch in plist:
          r0 = cur_row * (self.ph + self.border)
          c0 = cur_col * (self.pw + self.border)
          self.canvas[r0 : r0 + self.ph, c0 : c0 + self.pw] = patch
          cur_col += 1
          if cur_col == self.nr_col:
              cur_col = 0
              cur_row += 1
  
file_path: tensorpack/tensorpack/utils/viz.py
imports: import numpy
  import os
  import sys
  from ..utils.develop import create_dummy_func
  from .argtools import shape2d
  from .fs import mkdir_p
label_desc: Use image node_id 2 for calling the Canvas obj's underlying member method code with example usage: obj.draw_patches(plist) without return types