File tree Expand file tree Collapse file tree 5 files changed +14
-5
lines changed Expand file tree Collapse file tree 5 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,9 @@ interface was removed. (#5164)
3333- Added ML-Agents package settings. (#5027 )
3434- Make com.unity.modules.unityanalytics an optional dependency. (#5109 )
3535- Make com.unity.modules.physics and com.unity.modules.physics2d optional dependencies. (#5112 )
36+ - The default ` InferenceDevice ` is now ` InferenceDevice.Default ` , which is equivalent to ` InferenceDevice.Burst ` . If you
37+ depend on the previous behavior, you can explicitly set the Agent's ` InferenceDevice ` to ` InferenceDevice.CPU ` . (#5175 )
38+
3639#### ml-agents / ml-agents-envs / gym-unity (Python)
3740
3841### Bug Fixes
Original file line number Diff line number Diff line change @@ -617,7 +617,7 @@ void NotifyAgentDone(DoneReason doneReason)
617617 public void SetModel (
618618 string behaviorName ,
619619 NNModel model ,
620- InferenceDevice inferenceDevice = InferenceDevice . CPU )
620+ InferenceDevice inferenceDevice = InferenceDevice . Default )
621621 {
622622 if ( behaviorName == m_PolicyFactory . BehaviorName &&
623623 model == m_PolicyFactory . Model &&
Original file line number Diff line number Diff line change @@ -83,6 +83,7 @@ public ModelRunner(
8383 case InferenceDevice . Burst :
8484 executionDevice = WorkerFactory . Type . CSharpBurst ;
8585 break ;
86+ case InferenceDevice . Default : // fallthrough
8687 default :
8788 executionDevice = WorkerFactory . Type . CSharpBurst ;
8889 break ;
Original file line number Diff line number Diff line change @@ -13,10 +13,9 @@ namespace Unity.MLAgents.Policies
1313 public enum InferenceDevice
1414 {
1515 /// <summary>
16- /// CPU inference. Corresponds to in WorkerFactory.Type.CSharp Barracuda.
17- /// Burst is recommended instead; this is kept for legacy compatibility.
16+ /// Default inference. This is currently the same as Burst, but may change in the future.
1817 /// </summary>
19- CPU = 0 ,
18+ Default = 0 ,
2019
2120 /// <summary>
2221 /// GPU inference. Corresponds to WorkerFactory.Type.ComputePrecompiled in Barracuda.
@@ -27,6 +26,12 @@ public enum InferenceDevice
2726 /// CPU inference using Burst. Corresponds to WorkerFactory.Type.CSharpBurst in Barracuda.
2827 /// </summary>
2928 Burst = 2 ,
29+
30+ /// <summary>
31+ /// CPU inference. Corresponds to in WorkerFactory.Type.CSharp Barracuda.
32+ /// Burst is recommended instead; this is kept for legacy compatibility.
33+ /// </summary>
34+ CPU = 3 ,
3035 }
3136
3237 /// <summary>
Original file line number Diff line number Diff line change @@ -109,7 +109,7 @@ public NNModel Model
109109 }
110110
111111 [ HideInInspector , SerializeField ]
112- InferenceDevice m_InferenceDevice = InferenceDevice . Burst ;
112+ InferenceDevice m_InferenceDevice = InferenceDevice . Default ;
113113
114114 /// <summary>
115115 /// How inference is performed for this Agent's model.
You can’t perform that action at this time.
0 commit comments