Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Commit

Permalink
Update NNIManager.getTrialJob to contain all hyper parameters (#1288)
Browse files Browse the repository at this point in the history
* Update NNIManager.getTrialJob
  • Loading branch information
chicm-ms authored Jul 18, 2019
1 parent 797f0e2 commit 227a461
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/nni_manager/core/nniDataStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ class NNIDataStore implements DataStore {

public async getTrialJob(trialJobId: string): Promise<TrialJobInfo> {
const trialJobs: TrialJobInfo[] = await this.queryTrialJobs(undefined, trialJobId);
assert(trialJobs.length <= 1);

return trialJobs[0];
}
Expand Down
6 changes: 2 additions & 4 deletions src/nni_manager/core/nnimanager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,8 @@ class NNIManager implements Manager {
});
}

public getTrialJob(trialJobId: string): Promise<TrialJobDetail> {
return Promise.resolve(
this.trainingService.getTrialJob(trialJobId)
);
public getTrialJob(trialJobId: string): Promise<TrialJobInfo> {
return this.dataStore.getTrialJob(trialJobId);
}

public async setClusterMetadata(key: string, value: string): Promise<void> {
Expand Down
7 changes: 6 additions & 1 deletion src/nni_manager/core/test/mockedDatastore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,12 @@ class MockedDataStore implements DataStore {
}

public getTrialJob(trialJobId: string): Promise<TrialJobInfo> {
throw new Error("Method not implemented.");
return Promise.resolve({
id: '1234',
status: 'SUCCEEDED',
startTime: Date.now(),
endTime: Date.now()
});
}

private async getFinalMetricData(trialJobId: string): Promise<any> {
Expand Down

0 comments on commit 227a461

Please sign in to comment.