Skip to content

Commit

Permalink
improve convert_to_HWC exception msgs (lanpa#355)
Browse files Browse the repository at this point in the history
* improve convert_to_HWC exception msgs

* fix lint
  • Loading branch information
boeddeker authored and lanpa committed Feb 27, 2019
1 parent 29e4a01 commit 5091d61
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tensorboardX/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,10 @@ def make_grid(I, ncols=8):

def convert_to_HWC(tensor, input_format): # tensor: numpy array
import numpy as np
assert(len(set(input_format)) == len(input_format)), "You can not use the same dimension shordhand twice."
assert(len(tensor.shape) == len(input_format)), "size of input tensor and input format are different"
assert(len(set(input_format)) == len(input_format)), "You can not use the same dimension shordhand twice. \
input_format: {}".format(input_format)
assert(len(tensor.shape) == len(input_format)), "size of input tensor and input format are different. \
tensor shape: {}, input_format: {}".format(tensor.shape, input_format)
input_format = input_format.upper()

if len(input_format) == 4:
Expand Down

0 comments on commit 5091d61

Please sign in to comment.