assertrt_val.dtype!=np.dtype('O'),"yielded data is not a valid tensor(number of elements on some dimension may differ)."
assertrt_val.dtype!=np.dtype('O'),"yielded data is not a valid tensor(number of elements on some dimension may differ)."
ifrt_val.dtype==np.dtype('float64'):
ifrt_val.dtype==np.dtype('float64'):
rt_val=rt_val.astype('float32')
rt_val=rt_val.astype('float32')
shape,dtype=attr
shape,dtype=attr
assertrt_val.dtype==np.dtype(dtype),message+"yielded data type not consistent with attr settings. Expect: {}, receive: {}.".format(rt_val.dtype,np.dtype(dtype))
assertrt_val.dtype==np.dtype(dtype),message+"yielded data type not consistent with attr settings. Expect: {}, receive: {}.".format(rt_val.dtype,np.dtype(dtype))
assertlen(shape)==rt_val.ndim,message+"yielded data rank(ndim) not consistent with attr settings. Expect: {}, receive: {}.".format(len(shape),rt_val.ndim)
assertlen(shape)==rt_val.ndim,message+"yielded data rank(ndim) not consistent with attr settings. Expect: {}, receive: {}.".format(len(shape),rt_val.ndim)