(np_imgs, img_path)
Args:
    np_imgs: [N, H, W, 3] float32
    img_path: str
Args:
    np_imgs: [N, H, W, 3] float32
    img_path: str
Args : np_imgs : [ N H W 3 ] float32 img_path : str
def save_samples(np_imgs, img_path):
  """
  Args:
    np_imgs: [N, H, W, 3] float32
    img_path: str
  """
  np_imgs = np_imgs.astype(np.uint8)
  N, H, W, _ = np_imgs.shape
  num = int(N ** (0.5))
  merge_img = np.zeros((num * H, num * W, 3), dtype=np.uint8)
  for i in range(num):
    for j in range(num):
      merge_img[i*H:(i+1)*H, j*W:(j+1)*W, :] = np_imgs[i*num+j,:,:,:]

  imsave(img_path, merge_img)
def save_samples ( np_imgs , img_path ) : np_imgs = np_imgs . astype ( np . uint8 ) N , H , W , _ = np_imgs . shape num = int ( N ** ( 0.5 ) ) merge_img = np . zeros ( ( num * H , num * W , 3 ) , dtype = np . uint8 ) for i in range ( num ) : for j in range ( num ) : merge_img [ i * H : ( i + 1 ) * H , j * W : ( j + 1 ) * W , : ] = np_imgs [ i * num + j , : , : , : ] imsave ( img_path , merge_img )