-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make ActionSpec ctor public #4896
Conversation
@@ -66,10 +66,17 @@ public static ActionSpec MakeDiscrete(params int[] branchSizes) | |||
return actuatorSpace; | |||
} | |||
|
|||
internal ActionSpec(int numContinuousActions, int[] branchSizes = null) | |||
/// <summary> | |||
/// Create an ActionSpec initialized with the specified action sizes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to propose adding "Writing docstrings for constructors" to the list of "Hard things in Computer Science".
/// <param name="discreteBranchSizes">The array of branch sizes for the discrete actions. Each index | ||
/// contains the number of actions available for that branch.</param> | ||
/// <returns>An ActionSpec initialized with the specified action sizes.</returns> | ||
public ActionSpec(int numContinuousActions = 0, int[] discreteBranchSizes = null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MakeDiscrete uses the params int[]
syntactic sugar, but I feel like adding that here is potentially confusing.
Proposed change(s)
We don't currently have any way to create an ActionSpec from code that uses both discrete and continuous actions. This makes the previously internal constructor public, and adds it to the public API test.
Useful links (Github issues, JIRA tickets, ML-Agents forum threads etc.)
https://jira.unity3d.com/browse/MLA-1740
Types of change(s)
Checklist