update TF models (beta version)
This commit is contained in:
		| @@ -1,37 +1,27 @@ | ||||
| # Copyright (c) Facebook, Inc. and its affiliates. | ||||
| # All rights reserved. | ||||
| # | ||||
| # This source code is licensed under the license found in the | ||||
| # LICENSE file in the root directory of this source tree. | ||||
| # | ||||
| ################################################## | ||||
| # Copyright (c) Xuanyi Dong [GitHub D-X-Y], 2019 # | ||||
| ################################################## | ||||
| import time, sys | ||||
| import numpy as np | ||||
|  | ||||
| def time_for_file(): | ||||
|   ISOTIMEFORMAT='%d-%h-at-%H-%M-%S' | ||||
|   return '{}'.format(time.strftime( ISOTIMEFORMAT, time.gmtime(time.time()) )) | ||||
|   return '{:}'.format(time.strftime( ISOTIMEFORMAT, time.gmtime(time.time()) )) | ||||
|  | ||||
| def time_string(): | ||||
|   ISOTIMEFORMAT='%Y-%m-%d %X' | ||||
|   string = '[{}]'.format(time.strftime( ISOTIMEFORMAT, time.gmtime(time.time()) )) | ||||
|   string = '[{:}]'.format(time.strftime( ISOTIMEFORMAT, time.gmtime(time.time()) )) | ||||
|   return string | ||||
|  | ||||
| def time_string_short(): | ||||
|   ISOTIMEFORMAT='%Y%m%d' | ||||
|   string = '{}'.format(time.strftime( ISOTIMEFORMAT, time.gmtime(time.time()) )) | ||||
|   string = '{:}'.format(time.strftime( ISOTIMEFORMAT, time.gmtime(time.time()) )) | ||||
|   return string | ||||
|  | ||||
| def time_print(string, is_print=True): | ||||
|   if (is_print): | ||||
|     print('{} : {}'.format(time_string(), string)) | ||||
|  | ||||
| def convert_size2str(torch_size): | ||||
|   dims = len(torch_size) | ||||
|   string = '[' | ||||
|   for idim in range(dims): | ||||
|     string = string + ' {}'.format(torch_size[idim]) | ||||
|   return string + ']' | ||||
|    | ||||
| def convert_secs2time(epoch_time, return_str=False):     | ||||
|   need_hour = int(epoch_time / 3600) | ||||
|   need_mins = int((epoch_time - 3600*need_hour) / 60)   | ||||
|   | ||||
		Reference in New Issue
	
	Block a user