Exemple #1
0
    def test_display_tensorboard(self, mock_open, mock_os, mock_json):
        mock_os.path.isfile.return_value = False

        display.display(display.Tensorboard('gs://job/dir'))

        mock_json.dump.assert_called_with(
            {'outputs': [{
                'type': 'tensorboard',
                'source': 'gs://job/dir'
            }]}, mock.ANY)
Exemple #2
0
def _dump_job_metadata(project_id, job_id, job):
    display.display(
        display.Link(
            'https://console.cloud.google.com/mlengine/jobs/{}?project={}'.
            format(job_id, project_id), 'Job Details'))
    display.display(
        display.Link(
            'https://console.cloud.google.com/logs/viewer?project={}&resource=ml_job/job_id/{}&interval=NO_LIMIT'
            .format(project_id, job_id), 'Logs'))
    if 'trainingInput' in job and 'jobDir' in job['trainingInput']:
        display.display(display.Tensorboard(job['trainingInput']['jobDir']))
Exemple #3
0
 def test___repr__(self, mock_open, mock_os, mock_json):
     self.assertEqual('# Title', str(display.Markdown('# Title')))
     self.assertEqual('Open Tensorboard at: gs://trained/model/',
                      str(display.Tensorboard('gs://trained/model/')))
     self.assertEqual('title: https://test/uri',
                      str(display.Link('https://test/uri', 'title')))