Skip to content

Commit fbd4de0

Browse files
authored
Preparation for syncing sources with internal repo (#275)
* make class partial so I can add constuctor in separate file. add constructros for testing * formatting
1 parent 9d19d0e commit fbd4de0

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/Microsoft.ML.Sweeper/AsyncSweeper.cs

+11-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public interface IAsyncSweeper
6363
/// Expose existing <see cref="ISweeper"/>s as <see cref="IAsyncSweeper"/> with no synchronization over the past runs.
6464
/// Nelder-Mead requires synchronization so is not compatible with SimpleAsyncSweeperBase.
6565
/// </summary>
66-
public class SimpleAsyncSweeper : IAsyncSweeper, IDisposable
66+
public partial class SimpleAsyncSweeper : IAsyncSweeper, IDisposable
6767
{
6868
private readonly List<IRunResult> _results;
6969
private readonly object _lock;
@@ -85,6 +85,16 @@ private SimpleAsyncSweeper(ISweeper baseSweeper)
8585
_results = new List<IRunResult>();
8686
}
8787

88+
public SimpleAsyncSweeper(IHostEnvironment env, UniformRandomSweeper.ArgumentsBase args)
89+
: this(new UniformRandomSweeper(env, args))
90+
{
91+
}
92+
93+
public SimpleAsyncSweeper(IHostEnvironment env, RandomGridSweeper.Arguments args)
94+
: this(new UniformRandomSweeper(env, args))
95+
{
96+
}
97+
8898
public void Update(int id, IRunResult result)
8999
{
90100
Contracts.CheckParam(0 <= id && id < _numGenerated, nameof(id), "Invalid run id");

0 commit comments

Comments
 (0)