https://github.com/tensorlayer/tensorlayer/blob/4db0b9f52f629742967eb05e3ddb1a23a5ca666f/tensorlayer/utils.py#L323