e70a1e3fddeb24c02ea56f74ff4ce33c8642ac0c,autokeras/utils.py,,get_device,#,47

Before Change


            //       Free                 : xxxxxx MiB
            //                      ....
            smi_out = subprocess.check_output("nvidia-smi -q -d Memory | grep -A4 GPU|grep Free", shell=True)
            print(smi_out.decode("utf-8"))
        except subprocess.SubprocessError:
            warnings.warn("Cuda device successfully detected. However, nvidia-smi cannot be invoked")
            return "cpu"

After Change


            //       Free                 : xxxxxx MiB
            //                      ....
            smi_out = subprocess.check_output("nvidia-smi -q -d Memory | grep -A4 GPU|grep Free", shell=True)
            if isinstance(smi_out, bytes):
                smi_out = smi_out.decode("utf-8")
            print(smi_out)
        except subprocess.SubprocessError:
            warnings.warn("Cuda device successfully detected. However, nvidia-smi cannot be invoked")
            return "cpu"
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: jhfjhfj1/autokeras
Commit Name: e70a1e3fddeb24c02ea56f74ff4ce33c8642ac0c
Time: 2018-11-15
Author: jhfjhfj1@gmail.com
File Name: autokeras/utils.py
Class Name:
Method Name: get_device


Project Name: polyaxon/polyaxon
Commit Name: 1bd57b89cb0deed5081540e5b29f7531215fa121
Time: 2018-10-17
Author: mouradmourafiq@gmail.com
File Name: polyaxon_client/transport/socket_transport.py
Class Name: SocketTransportMixin
Method Name: _on_message