Skip to content

Commit

Permalink
Wording change: New up a specific type, rather than just object
Browse files Browse the repository at this point in the history
In algorithms that mint MLActivations and MLOperands, construct
the actual type not a generic "object". Also, use Infra wording
around optional paramters to those algorithms.

For webmachinelearning#450
  • Loading branch information
inexorabletash committed Jan 18, 2024
1 parent 50a00b9 commit 405c85c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -897,18 +897,18 @@ The {{MLActivation}} objects (including the ones passed as input to methods) are

<details open algorithm>
<summary>
To <dfn>create an MLActivation</dfn> given |builder|, |name|, |options| and |init-steps|, run the following steps:
To <dfn>create an MLActivation</dfn> given |builder|, |name|, optional |options| and optional |init-steps|, run the following steps:
</summary>
<div class=algorithm-steps>
1. Let |activation| be a new [=object=].
1. Let |activation| be a new {{MLActivation}}.
1. Set |activation|.{{MLActivation/[[builder]]}} to |builder|.
1. Set |activation|.{{MLActivation/[[name]]}} to |name|.
1. If |options| is an [=object=], set |activation|.{{MLActivation/[[options]]}} to |options|.
1. If |options| is given, set |activation|.{{MLActivation/[[options]]}} to |options|.
1. If any of the following sub-steps fail, [=exception/throw=] an "{{OperationError}}" {{DOMException}}.
1. Make a request to the underlying platform to:
1. Create an [=implementation-defined=] platform operator |opImpl| for the given |name| operation.
1. Set |activation|.{{MLActivation/[[operator]]}} to |opImpl|.
1. If |init-steps| are defined, run |init-steps| with |options|.
1. If |init-steps| are given, run |init-steps| with |options|.
1. Otherwise, initialize |activation|.{{MLActivation/[[operator]]}} given |options| in an [=implementation-defined=] way for the given |name| operation.
1. Return |activation|.
</div>
Expand Down Expand Up @@ -6185,7 +6185,7 @@ The {{MLOperand}} objects are created by the methods of {{MLGraphBuilder}}, inte
<div class=algorithm-steps>
1. [=Assert=]: the type of |builder| is {{MLGraphBuilder}}.
1. [=Assert=]: the type of |desc| is {{MLOperandDescriptor}}.
1. Let |operand| be a new [=object=].
1. Let |operand| be a new {{MLOperand}}.
1. Set |operand|.{{MLOperand/[[builder]]}} to |builder|.
1. Set |operand|.{{MLOperand/[[descriptor]]}} to |desc|.
1. Return |operand|.
Expand All @@ -6198,7 +6198,7 @@ The {{MLOperand}} objects are created by the methods of {{MLGraphBuilder}}, inte
</summary>
<div class=algorithm-steps>
1. [=Assert=]: the type of |operand| is {{MLOperand}}.
1. Let |result| be a new [=object=].
1. Let |result| be a new {{MLOperand}}.
1. Set |result|.{{MLOperand/[[builder]]}} to |operand|.{{MLOperand/[[builder]]}}.
1. Set |result|.{{MLOperand/[[descriptor]]}} to |operand|.{{MLOperand/[[descriptor]]}}.
1. If |operand|.{{MLOperand/[[name]]}} [=map/exists=], then set |result|.{{MLOperand/[[name]]}} to |operand|.{{MLOperand/[[name]]}}.
Expand Down

0 comments on commit 405c85c

Please sign in to comment.