You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Fix dimensions for 0D scalars
* Code review comments
* reshape CR feedback
* More CR feedback
* Minor cleanup
* Fix bikeshed validation on LSTM tensor names
* Fix reshape bad merge
* Unbracket MLCommandEncoder in status text to appease bikeshed
* CR feedback
* Fix empty reshape dimensions to 1, not 0
1. Let |numDirections| be 1 if |options|.{{MLLstmOptions/direction}} is {{MLRecurrentNetworkDirection/"forward"}}, or otherwise let it be 2.
3998
-
<div class="issue">
3999
-
The shape of |input|, |weight| or |recurrentWeight| could be also checked here.
4000
-
</div>
3995
+
1. If the [=rank=] of |input| or |weight| or |recurrentWeight| is not 3, then [=exception/throw=] a "{{DataError}}" {{DOMException}}.
4001
3996
1. If |input|.{{MLOperand/[[descriptor]]}}.{{MLOperandDescriptor/dimensions}}[0] is not equal to |steps|, then [=exception/throw=] a "{{DataError}}" {{DOMException}}.
4002
3997
1. Let |batchSize| be |input|.{{MLOperand/[[descriptor]]}}.{{MLOperandDescriptor/dimensions}}[1].
4003
3998
1. If |options|.{{MLLstmOptions/bias}}[=map/exists=]:
1. Let |outputShape| be an empty array of {{unsigned long}}.
5123
-
1. If |newShape| is a scalar [=number=], set |outputShape| to the [=/list=] « 1 ».
5124
-
1. Otherwise, if |newShape| is an array of {{unsigned long}}:
5125
-
1. If the [=list/size=] of |newShape| is 0, set |outputShape| to the [=/list=] « 1 » (reshaping to scalar).
5126
-
1. If any value in |newShape| is 0, then [=exception/throw=] a "{{DataError}}" {{DOMException}}.
5127
-
1. Let |inputElementCount| be the product of all elements in |input|.{{MLOperand/[[descriptor]]}}.{{MLOperandDescriptor/dimensions}}.
5128
-
1. If product of all values in |newShape| is not equal to |inputElementCount|, then [=exception/throw=] a "{{DataError}}" {{DOMException}}.
5118
+
1. If the [=list/size=] of |newShape| is 0, set |outputShape| to an empty [=/list=] for a scalar.
5119
+
1. If any value in |newShape| is 0, then [=exception/throw=] a "{{DataError}}" {{DOMException}}.
5120
+
1. Let |inputElementCount| be the product of all elements in |input|.{{MLOperand/[[descriptor]]}}.{{MLOperandDescriptor/dimensions}}. Empty dimensions yield an |inputElementCount| of 1.
5121
+
1. If product of all values in |newShape| is not equal to |inputElementCount|, then [=exception/throw=] a "{{DataError}}" {{DOMException}}.
5129
5122
1. Let |desc| be a copy of |input|.{{MLOperand/[[descriptor]]}}.
5130
5123
1. Set |desc|.{{MLOperandDescriptor/dimensions}} to |newShape|.
5131
5124
1. If any of the following sub-steps fail, [=exception/throw=] an "{{OperationError}}" {{DOMException}}.
@@ -5997,7 +5990,7 @@ The {{MLOperand}} objects are created by the methods of {{MLGraphBuilder}}, inte
5997
5990
<div class=algorithm-steps>
5998
5991
1. If |builder| is not equal to |operand|.{{MLOperand/[[builder]]}}, return false.
5999
5992
1. Let |desc| be |operand|.{{MLOperand/[[descriptor]]}}.
6000
-
1. If |desc|.{{MLOperandDescriptor/dimensions}}[=map/exists=] and [=checking dimensions=] given |desc|.{{MLOperandDescriptor/dimensions}} and |desc|.{{MLOperandDescriptor/dataType}} returns false, then return false.
5993
+
1. If [=checking dimensions=] given |desc|.{{MLOperandDescriptor/dimensions}} and |desc|.{{MLOperandDescriptor/dataType}} returns false, then return false.
0 commit comments