Question 32
Domain 4: Deploy and operationalize machine learning solutionsYou need to write a batch inference script using `ParallelRunStep`. Which two functions must be included?
Correct answer: B
Explanation
`ParallelRunStep` requires an entry script that defines `init()` and `run()` so the step can initialize resources and process each batch. The `init()` function is used to set up the model or other shared objects before inference begins, which is why it must be included.
Why each option is right or wrong
A. load()
B. init()
Azure Machine Learning’s `ParallelRunStep` entry script is required to expose an `init()` function and a `run(mini_batch)` function, as documented for parallel batch inference scripts. `init()` is invoked once on each worker before batch processing starts to load the model or other shared state, while `run()` is called for each mini-batch during execution; without `init()`, the step cannot perform the one-time initialization it expects.
C. run(mini_batch)
D. evaluate(mini_batch)
E. execute(mini_batch) **Correct answers:**