412 @return dictionary containing the variable attributes |
412 @return dictionary containing the variable attributes |
413 @rtype dict |
413 @rtype dict |
414 """ |
414 """ |
415 d = {} |
415 d = {} |
416 start = count = 0 |
416 start = count = 0 |
417 allItems = var.tolist() |
417 try: |
|
418 len(var) # Check if it's an unsized object, e.g. np.ndarray(()) |
|
419 allItems = var.tolist() |
|
420 except TypeError: # TypeError: len() of unsized object |
|
421 allItems = [] |
418 |
422 |
419 for idx, value in enumerate(allItems): |
423 for idx, value in enumerate(allItems): |
420 d[str(idx)] = value |
424 d[str(idx)] = value |
421 count += 1 |
425 count += 1 |
422 if count >= BatchSize: |
426 if count >= BatchSize: |