parameters: (sm, num_tiles, idx, cut_off, is_x)
return_statement: return sm
docstring: Cut the valid parts of the CNN predictions for a tile.
docstring_summary: Cut the valid parts of the CNN predictions for a tile.
docstring_tokens: Cut the valid parts of the CNN predictions for a tile .
function: def _cutoff_tile(sm, num_tiles, idx, cut_off, is_x):
      """Cut the valid parts of the CNN predictions for a tile."""
      if is_x:
          sm = sm.transpose((1, 0, 2, 3))
      if num_tiles == 1:
          pass
      elif idx == 1:
          sm = sm[:-cut_off, ...]
      elif idx == num_tiles:
          sm = sm[cut_off:, ...]
      else:
          sm = sm[cut_off:-cut_off, ...]
      if is_x:
          sm = sm.transpose((1, 0, 2, 3))
      return sm
function_tokens: def _cutoff_tile ( sm , num_tiles , idx , cut_off , is_x ) : if is_x : sm = sm . transpose ( ( 1 , 0 , 2 , 3 ) ) if num_tiles == 1 : pass elif idx == 1 : sm = sm [ : - cut_off , ... ] elif idx == num_tiles : sm = sm [ cut_off : , ... ] else : sm = sm [ cut_off : - cut_off , ... ] if is_x : sm = sm . transpose ( ( 1 , 0 , 2 , 3 ) ) return sm