"docs/source/git@developer.sourcefind.cn:OpenDAS/nni.git" did not exist on "16c7f0d0134191e90c3e3f0e87bd40bb59a68e56"
Unverified Commit 8a9b2cb5 authored by SparkSnail's avatar SparkSnail Committed by GitHub
Browse files

Merge pull request #177 from microsoft/v0.8

merge V0.8
parents e1a4a80a e4f75024
...@@ -90,7 +90,7 @@ NNI's annotation compiler transforms the annotated trial code to the code that c ...@@ -90,7 +90,7 @@ NNI's annotation compiler transforms the annotated trial code to the code that c
![](../img/nas_on_nni.png) ![](../img/nas_on_nni.png)
The above figure shows how the trial code runs on NNI. `nnictl` processes user trial code to generate a search space file and compiled trial code. The former is fed to tuner, and the latter is used to run trilas. The above figure shows how the trial code runs on NNI. `nnictl` processes user trial code to generate a search space file and compiled trial code. The former is fed to tuner, and the latter is used to run trials.
[__TODO__] Simple example of NAS on NNI. [__TODO__] Simple example of NAS on NNI.
......
...@@ -203,7 +203,7 @@ class NNIRestHandler { ...@@ -203,7 +203,7 @@ class NNIRestHandler {
res.send(); res.send();
} catch (err) { } catch (err) {
// setClusterMetata is a step of initialization, so any exception thrown is a fatal // setClusterMetata is a step of initialization, so any exception thrown is a fatal
this.handle_error(err, res, true); this.handle_error(NNIError.FromError(err), res, true);
} }
}); });
} }
......
...@@ -149,7 +149,7 @@ else: ...@@ -149,7 +149,7 @@ else:
chosen_layer = mutable_block[mutable_layer_id]["chosen_layer"] chosen_layer = mutable_block[mutable_layer_id]["chosen_layer"]
chosen_inputs = mutable_block[mutable_layer_id]["chosen_inputs"] chosen_inputs = mutable_block[mutable_layer_id]["chosen_inputs"]
real_chosen_inputs = [optional_inputs[input_name] for input_name in chosen_inputs] real_chosen_inputs = [optional_inputs[input_name] for input_name in chosen_inputs]
layer_out = funcs[chosen_layer]([fixed_inputs, real_chosen_inputs], *funcs_args[chosen_layer]) layer_out = funcs[chosen_layer]([fixed_inputs, real_chosen_inputs], **funcs_args[chosen_layer])
return layer_out return layer_out
......
...@@ -60,7 +60,7 @@ def parse_annotation_mutable_layers(code, lineno): ...@@ -60,7 +60,7 @@ def parse_annotation_mutable_layers(code, lineno):
kw_args = [] kw_args = []
kw_values = [] kw_values = []
for kw in call.keywords: for kw in call.keywords:
kw_args.append(kw.arg) kw_args.append(ast.Str(s=kw.arg))
kw_values.append(kw.value) kw_values.append(kw.value)
call_kwargs_values.append(ast.Dict(keys=kw_args, values=kw_values)) call_kwargs_values.append(ast.Dict(keys=kw_args, values=kw_values))
call_funcs = ast.Dict(keys=call_funcs_keys, values=call_funcs_values) call_funcs = ast.Dict(keys=call_funcs_keys, values=call_funcs_values)
...@@ -314,20 +314,20 @@ class Transformer(ast.NodeTransformer): ...@@ -314,20 +314,20 @@ class Transformer(ast.NodeTransformer):
else: else:
return node # not an annotation, ignore it return node # not an annotation, ignore it
if string.startswith('@nni.get_next_parameter('): if string.startswith('@nni.get_next_parameter'):
deprecated_message = "'@nni.get_next_parameter' is deprecated in annotation due to inconvenience. Please remove this line in the trial code." deprecated_message = "'@nni.get_next_parameter' is deprecated in annotation due to inconvenience. Please remove this line in the trial code."
print_warning(deprecated_message) print_warning(deprecated_message)
if string.startswith('@nni.report_intermediate_result(') \ if string.startswith('@nni.report_intermediate_result') \
or string.startswith('@nni.report_final_result(') \ or string.startswith('@nni.report_final_result') \
or string.startswith('@nni.get_next_parameter('): or string.startswith('@nni.get_next_parameter'):
return parse_annotation(string[1:]) # expand annotation string to code return parse_annotation(string[1:]) # expand annotation string to code
if string.startswith('@nni.mutable_layers('): if string.startswith('@nni.mutable_layers'):
return parse_annotation_mutable_layers(string[1:], node.lineno) return parse_annotation_mutable_layers(string[1:], node.lineno)
if string.startswith('@nni.variable(') \ if string.startswith('@nni.variable') \
or string.startswith('@nni.function_choice('): or string.startswith('@nni.function_choice'):
self.stack[-1] = string[1:] # mark that the next expression is annotated self.stack[-1] = string[1:] # mark that the next expression is annotated
return None return None
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment