Skip to content

Commit

Permalink
Update gemm to check c data type too
Browse files Browse the repository at this point in the history
  • Loading branch information
fdwr authored Apr 26, 2024
1 parent bd9b0cf commit ad239bc
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -2966,10 +2966,9 @@ partial interface MLGraphBuilder {
1. If |options|.{{MLGemmOptions/aTranspose}} is true, then reverse the order of the items in |shapeA|.
1. If |options|.{{MLGemmOptions/bTranspose}} is true, then reverse the order of the items in |shapeB|.
1. If |shapeA|[1] is not equal to |shapeB|[0], then [=exception/throw=] a {{TypeError}}.
1. If |options|.{{MLGemmOptions/c}} [=map/exists=] and is not [=unidirectionally broadcastable=] to the shape « |shapeA|[0], |shapeB|[1] », then [=exception/throw=] a {{TypeError}}.
<div class="note">
Type compatibility between |a|, |b| and |options|.{{MLGemmOptions/c}} can be also checked.
</div>
1. If |options|.{{MLGemmOptions/c}} [=map/exists=]:
1. If it is not [=unidirectionally broadcastable=] to the shape « |shapeA|[0], |shapeB|[1] », then [=exception/throw=] a {{TypeError}}.
1. If its [=MLOperand/dataType=] is not equal to |a|'s [=MLOperand/dataType=], then [=exception/throw=] a {{TypeError}}.
1. Let |desc| be a new {{MLOperandDescriptor}}.
1. Set |desc|.{{MLOperandDescriptor/dimensions}} to the [=/list=] « |shapeA|[0], |shapeB|[1] ».
1. Set |desc|.{{MLOperandDescriptor/dataType}} to |a|'s [=MLOperand/dataType=].
Expand Down

0 comments on commit ad239bc

Please sign in to comment.