You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2021/01/13 01:51:13 UTC
[GitHub] [tvm] ANSHUMAN87 opened a new pull request #7267: [Frontend][Tensorflow] Sparse dense matmul adjoint option added
ANSHUMAN87 opened a new pull request #7267:
URL: https://github.com/apache/tvm/pull/7267
This is a follow up PR!
Adjoint option support for both input added in this PR
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] ANSHUMAN87 commented on a change in pull request #7267: [Frontend][Tensorflow] Sparse dense matmul adjoint option added
Posted by GitBox <gi...@apache.org>.
ANSHUMAN87 commented on a change in pull request #7267:
URL: https://github.com/apache/tvm/pull/7267#discussion_r565007656
##########
File path: python/tvm/relay/frontend/tensorflow.py
##########
@@ -941,9 +934,48 @@ def _impl(inputs, attr, params, mod):
(values_tensor, (rows, cols)), shape=tuple(dense_shape_tensor.tolist())
)
+ # As per tensorflow implementation, we have 4 possible input combination
+ # and the first input(A) is always sparse and second input(B) is always dense.
+ # Case 1: A , B , adjoint_a=False, adjoint_b=False --> A * B
+ # Case 2: A , B , adjoint_a=True, adjoint_b=False --> A.T * B
+ # Case 3: A , B , adjoint_a=False, adjoint_b=True --> A * B.T
+ # Case 4: A , B , adjoint_a=True, adjoint_b=True --> (A.T * B.T).T
+ #
+ # Topi implementation for sparse_dense(matmul) has 2 possible input
+ # combination where first input(A) is always dense
+ # and second input(B) is always sparse.
+ # Case 1: A , B, sparse_lhs = False --> A * B.T
+ # Case 2: A , B, sparse_lhs = True --> B * A.T
+ #
+ # The mapping would be as below:
+ # TF Case 1: A , B , adjoint_a=False, adjoint_b=False
Review comment:
Done!
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] tkonolige commented on a change in pull request #7267: [Frontend][Tensorflow] Sparse dense matmul adjoint option added
Posted by GitBox <gi...@apache.org>.
tkonolige commented on a change in pull request #7267:
URL: https://github.com/apache/tvm/pull/7267#discussion_r562220135
##########
File path: python/tvm/relay/frontend/tensorflow.py
##########
@@ -942,7 +942,10 @@ def _impl(inputs, attr, params, mod):
)
if sparse_lhs:
- data = _op.transpose(data)
+ if attr.get("adjoint_a"):
Review comment:
This logic is very confusing. I've looked over it a couple of time and I'm still not sure if it is correct. How about you document all the cases like this:
```
A B -> (B.T A.T).T -> transpose(sparse_dense(transpose(B), A, sparse_lhs=false))
A B.T -> ??
A.T B -> ??
A.T B.T -> ??
```
And then you can make a series of if statements that match these cases.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] FrozenGene merged pull request #7267: [Frontend][Tensorflow] Sparse dense matmul adjoint option added
Posted by GitBox <gi...@apache.org>.
FrozenGene merged pull request #7267:
URL: https://github.com/apache/tvm/pull/7267
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] tkonolige commented on a change in pull request #7267: [Frontend][Tensorflow] Sparse dense matmul adjoint option added
Posted by GitBox <gi...@apache.org>.
tkonolige commented on a change in pull request #7267:
URL: https://github.com/apache/tvm/pull/7267#discussion_r563852228
##########
File path: python/tvm/relay/frontend/tensorflow.py
##########
@@ -941,9 +934,48 @@ def _impl(inputs, attr, params, mod):
(values_tensor, (rows, cols)), shape=tuple(dense_shape_tensor.tolist())
)
+ # As per tensorflow implementation, we have 4 possible input combination
+ # and the first input(A) is always sparse and second input(B) is always dense.
+ # Case 1: A , B , adjoint_a=False, adjoint_b=False --> A * B
+ # Case 2: A , B , adjoint_a=True, adjoint_b=False --> A.T * B
+ # Case 3: A , B , adjoint_a=False, adjoint_b=True --> A * B.T
+ # Case 4: A , B , adjoint_a=True, adjoint_b=True --> (A.T * B.T).T
+ #
+ # Topi implementation for sparse_dense(matmul) has 2 possible input
+ # combination where first input(A) is always dense
+ # and second input(B) is always sparse.
+ # Case 1: A , B, sparse_lhs = False --> A * B.T
+ # Case 2: A , B, sparse_lhs = True --> B * A.T
+ #
+ # The mapping would be as below:
+ # TF Case 1: A , B , adjoint_a=False, adjoint_b=False
Review comment:
I think the implicit part is hard to understand unless you've written this code or thought about it a lot.
##########
File path: python/tvm/relay/frontend/tensorflow.py
##########
@@ -941,8 +934,47 @@ def _impl(inputs, attr, params, mod):
(values_tensor, (rows, cols)), shape=tuple(dense_shape_tensor.tolist())
)
- if sparse_lhs:
+ # As per tensorflow implementation, we have 4 possible input combination
+ # and the first input(A) is always sparse and second input(B) is always dense.
+ # Case 1: A , B , adjoint_a=False, adjoint_b=False --> A * B
+ # Case 2: A , B , adjoint_a=True, adjoint_b=False --> A.T * B
+ # Case 3: A , B , adjoint_a=False, adjoint_b=True --> A * B.T
+ # Case 4: A , B , adjoint_a=True, adjoint_b=True --> (A.T * B.T).T
+ #
+ # Topi implementation for sparse_dense(matmul) has 2 possible input
+ # combination where first input(A) is always dense
+ # and second input(B) is always sparse.
+ # Case 1: A , B, sparse_lhs = False --> A * B.T
+ # Case 2: A , B, sparse_lhs = True --> B * A.T
+ #
+ # The mapping would be as below:
+ # TF Case 1: A , B , adjoint_a=False, adjoint_b=False
+ # --> sparse_dense(transpose(B), A, sparse_lhs=True)
+ #
+ # TF Case 2: A , B , adjoint_a=True, adjoint_b=False
+ # --> sparse_dense(transpose(B), transpose(A), sparse_lhs=True)
+ #
+ # TF Case 3: A , B , adjoint_a=False, adjoint_b=True
+ # --> sparse_dense(B, A, sparse_lhs=True)
+ #
+ # TF Case 4: A , B , adjoint_a=True, adjoint_b=True
+ # --> transpose(sparse_dense(B, transpose(A), sparse_lhs=False))
+
+ # By default, in tensorflow the first input ,i.e., data is sparse
+ sparse_lhs = True
+
+ # TF Case 1:
+ if not attr.get("adjoint_a") and not attr.get("adjoint_b"):
+ data = _op.transpose(data)
+ # TF Case 2:
+ elif attr.get("adjoint_a") and not attr.get("adjoint_b"):
data = _op.transpose(data)
+ weight_sp = csr_matrix(weight_sp.transpose())
+ # TF Case 3:
+ elif not attr.get("adjoint_a") and attr.get("adjoint_b"):
+ pass
+ # TF Case 4:
+ # attr.get("adjoint_a") and attr.get("adjoint_b"):
else:
weight_sp = csr_matrix(weight_sp.transpose())
Review comment:
I think you are missing a `sparse_lhs=False` here.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] ANSHUMAN87 commented on a change in pull request #7267: [Frontend][Tensorflow] Sparse dense matmul adjoint option added
Posted by GitBox <gi...@apache.org>.
ANSHUMAN87 commented on a change in pull request #7267:
URL: https://github.com/apache/tvm/pull/7267#discussion_r563293629
##########
File path: python/tvm/relay/frontend/tensorflow.py
##########
@@ -941,9 +934,48 @@ def _impl(inputs, attr, params, mod):
(values_tensor, (rows, cols)), shape=tuple(dense_shape_tensor.tolist())
)
+ # As per tensorflow implementation, we have 4 possible input combination
+ # and the first input(A) is always sparse and second input(B) is always dense.
+ # Case 1: A , B , adjoint_a=False, adjoint_b=False --> A * B
+ # Case 2: A , B , adjoint_a=True, adjoint_b=False --> A.T * B
+ # Case 3: A , B , adjoint_a=False, adjoint_b=True --> A * B.T
+ # Case 4: A , B , adjoint_a=True, adjoint_b=True --> (A.T * B.T).T
+ #
+ # Topi implementation for sparse_dense(matmul) has 2 possible input
+ # combination where first input(A) is always dense
+ # and second input(B) is always sparse.
+ # Case 1: A , B, sparse_lhs = False --> A * B.T
+ # Case 2: A , B, sparse_lhs = True --> B * A.T
+ #
+ # The mapping would be as below:
+ # TF Case 1: A , B , adjoint_a=False, adjoint_b=False
Review comment:
This part is already explained in the above comment section, it is implicit. I think it is okay.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] ANSHUMAN87 commented on a change in pull request #7267: [Frontend][Tensorflow] Sparse dense matmul adjoint option added
Posted by GitBox <gi...@apache.org>.
ANSHUMAN87 commented on a change in pull request #7267:
URL: https://github.com/apache/tvm/pull/7267#discussion_r563293446
##########
File path: python/tvm/relay/frontend/tensorflow.py
##########
@@ -942,7 +942,10 @@ def _impl(inputs, attr, params, mod):
)
if sparse_lhs:
- data = _op.transpose(data)
+ if attr.get("adjoint_a"):
Review comment:
Done!
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] tkonolige commented on a change in pull request #7267: [Frontend][Tensorflow] Sparse dense matmul adjoint option added
Posted by GitBox <gi...@apache.org>.
tkonolige commented on a change in pull request #7267:
URL: https://github.com/apache/tvm/pull/7267#discussion_r562220135
##########
File path: python/tvm/relay/frontend/tensorflow.py
##########
@@ -942,7 +942,10 @@ def _impl(inputs, attr, params, mod):
)
if sparse_lhs:
- data = _op.transpose(data)
+ if attr.get("adjoint_a"):
Review comment:
This logic is very confusing. I've looked over it a couple of time and I'm still not sure if it is correct. How about you document all the cases like this:
```
A B -> (B.T A.T).T -> transpose(sparse_dense(transpose(B), A, sparse_lhs=false))
A B.T -> ??
A.T B -> ??
A.T B.T -> ??
```
And then you can make a series of if statements that match these cases.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] ANSHUMAN87 commented on a change in pull request #7267: [Frontend][Tensorflow] Sparse dense matmul adjoint option added
Posted by GitBox <gi...@apache.org>.
ANSHUMAN87 commented on a change in pull request #7267:
URL: https://github.com/apache/tvm/pull/7267#discussion_r562744658
##########
File path: python/tvm/relay/frontend/tensorflow.py
##########
@@ -942,7 +942,10 @@ def _impl(inputs, attr, params, mod):
)
if sparse_lhs:
- data = _op.transpose(data)
+ if attr.get("adjoint_a"):
Review comment:
Yes i agree the logic is not straight forward, however it is to match the operation towards Topi Op.
I think matching series of If may not be good as it will branch out complete code if we want to tag with each case.
But i can try putting some comment over the current code, so that it will help to understand logic better. Please let me know if you think otherwise.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] ANSHUMAN87 commented on a change in pull request #7267: [Frontend][Tensorflow] Sparse dense matmul adjoint option added
Posted by GitBox <gi...@apache.org>.
ANSHUMAN87 commented on a change in pull request #7267:
URL: https://github.com/apache/tvm/pull/7267#discussion_r562791091
##########
File path: python/tvm/relay/frontend/tensorflow.py
##########
@@ -942,7 +942,10 @@ def _impl(inputs, attr, params, mod):
)
if sparse_lhs:
- data = _op.transpose(data)
+ if attr.get("adjoint_a"):
Review comment:
@tkonolige : I have added few comments, would you please take a look. Thanks!
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] FrozenGene commented on pull request #7267: [Frontend][Tensorflow] Sparse dense matmul adjoint option added
Posted by GitBox <gi...@apache.org>.
FrozenGene commented on pull request #7267:
URL: https://github.com/apache/tvm/pull/7267#issuecomment-768819796
Thanks @tkonolige @ANSHUMAN87
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] tkonolige commented on a change in pull request #7267: [Frontend][Tensorflow] Sparse dense matmul adjoint option added
Posted by GitBox <gi...@apache.org>.
tkonolige commented on a change in pull request #7267:
URL: https://github.com/apache/tvm/pull/7267#discussion_r562824062
##########
File path: python/tvm/relay/frontend/tensorflow.py
##########
@@ -941,9 +934,48 @@ def _impl(inputs, attr, params, mod):
(values_tensor, (rows, cols)), shape=tuple(dense_shape_tensor.tolist())
)
+ # As per tensorflow implementation, we have 4 possible input combination
+ # and the first input(A) is always sparse and second input(B) is always dense.
+ # Case 1: A , B , adjoint_a=False, adjoint_b=False --> A * B
+ # Case 2: A , B , adjoint_a=True, adjoint_b=False --> A.T * B
+ # Case 3: A , B , adjoint_a=False, adjoint_b=True --> A * B.T
+ # Case 4: A , B , adjoint_a=True, adjoint_b=True --> (A.T * B.T).T
+ #
+ # Topi implementation for sparse_dense(matmul) has 2 possible input
+ # combination where first input(A) is always dense
+ # and second input(B) is always sparse.
+ # Case 1: A , B, sparse_lhs = False --> A * B.T
+ # Case 2: A , B, sparse_lhs = True --> B * A.T
+ #
+ # The mapping would be as below:
+ # TF Case 1: A , B , adjoint_a=False, adjoint_b=False
Review comment:
Could you show the intermediate steps here. i.e. `A * B --> A * B.T.T --> sparse_dense(B.T, A, sparse_lhs=True)`
##########
File path: python/tvm/relay/frontend/tensorflow.py
##########
@@ -942,7 +942,10 @@ def _impl(inputs, attr, params, mod):
)
if sparse_lhs:
- data = _op.transpose(data)
+ if attr.get("adjoint_a"):
Review comment:
Given the comment has 4 cases, I think it is most intuitive if the if-cases follow the same structure.
```python
if adjoint_a and adjoint_b:
B = transpose(B)
sparse_lhs = True
elif adjoint_a and not adjoint_b:
...
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] ANSHUMAN87 commented on pull request #7267: [Frontend][Tensorflow] Sparse dense matmul adjoint option added
Posted by GitBox <gi...@apache.org>.
ANSHUMAN87 commented on pull request #7267:
URL: https://github.com/apache/tvm/pull/7267#issuecomment-768816905
Thanks @tkonolige !
Gentle ping @FrozenGene!
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] ANSHUMAN87 commented on pull request #7267: [Frontend][Tensorflow] Sparse dense matmul adjoint option added
Posted by GitBox <gi...@apache.org>.
ANSHUMAN87 commented on pull request #7267:
URL: https://github.com/apache/tvm/pull/7267#issuecomment-763715317
cc @tkonolige , @FrozenGene
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] ANSHUMAN87 commented on a change in pull request #7267: [Frontend][Tensorflow] Sparse dense matmul adjoint option added
Posted by GitBox <gi...@apache.org>.
ANSHUMAN87 commented on a change in pull request #7267:
URL: https://github.com/apache/tvm/pull/7267#discussion_r564993711
##########
File path: python/tvm/relay/frontend/tensorflow.py
##########
@@ -941,8 +934,47 @@ def _impl(inputs, attr, params, mod):
(values_tensor, (rows, cols)), shape=tuple(dense_shape_tensor.tolist())
)
- if sparse_lhs:
+ # As per tensorflow implementation, we have 4 possible input combination
+ # and the first input(A) is always sparse and second input(B) is always dense.
+ # Case 1: A , B , adjoint_a=False, adjoint_b=False --> A * B
+ # Case 2: A , B , adjoint_a=True, adjoint_b=False --> A.T * B
+ # Case 3: A , B , adjoint_a=False, adjoint_b=True --> A * B.T
+ # Case 4: A , B , adjoint_a=True, adjoint_b=True --> (A.T * B.T).T
+ #
+ # Topi implementation for sparse_dense(matmul) has 2 possible input
+ # combination where first input(A) is always dense
+ # and second input(B) is always sparse.
+ # Case 1: A , B, sparse_lhs = False --> A * B.T
+ # Case 2: A , B, sparse_lhs = True --> B * A.T
+ #
+ # The mapping would be as below:
+ # TF Case 1: A , B , adjoint_a=False, adjoint_b=False
+ # --> sparse_dense(transpose(B), A, sparse_lhs=True)
+ #
+ # TF Case 2: A , B , adjoint_a=True, adjoint_b=False
+ # --> sparse_dense(transpose(B), transpose(A), sparse_lhs=True)
+ #
+ # TF Case 3: A , B , adjoint_a=False, adjoint_b=True
+ # --> sparse_dense(B, A, sparse_lhs=True)
+ #
+ # TF Case 4: A , B , adjoint_a=True, adjoint_b=True
+ # --> transpose(sparse_dense(B, transpose(A), sparse_lhs=False))
+
+ # By default, in tensorflow the first input ,i.e., data is sparse
+ sparse_lhs = True
+
+ # TF Case 1:
+ if not attr.get("adjoint_a") and not attr.get("adjoint_b"):
+ data = _op.transpose(data)
+ # TF Case 2:
+ elif attr.get("adjoint_a") and not attr.get("adjoint_b"):
data = _op.transpose(data)
+ weight_sp = csr_matrix(weight_sp.transpose())
+ # TF Case 3:
+ elif not attr.get("adjoint_a") and attr.get("adjoint_b"):
+ pass
+ # TF Case 4:
+ # attr.get("adjoint_a") and attr.get("adjoint_b"):
else:
weight_sp = csr_matrix(weight_sp.transpose())
Review comment:
Good catch!
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] tkonolige commented on a change in pull request #7267: [Frontend][Tensorflow] Sparse dense matmul adjoint option added
Posted by GitBox <gi...@apache.org>.
tkonolige commented on a change in pull request #7267:
URL: https://github.com/apache/tvm/pull/7267#discussion_r563852228
##########
File path: python/tvm/relay/frontend/tensorflow.py
##########
@@ -941,9 +934,48 @@ def _impl(inputs, attr, params, mod):
(values_tensor, (rows, cols)), shape=tuple(dense_shape_tensor.tolist())
)
+ # As per tensorflow implementation, we have 4 possible input combination
+ # and the first input(A) is always sparse and second input(B) is always dense.
+ # Case 1: A , B , adjoint_a=False, adjoint_b=False --> A * B
+ # Case 2: A , B , adjoint_a=True, adjoint_b=False --> A.T * B
+ # Case 3: A , B , adjoint_a=False, adjoint_b=True --> A * B.T
+ # Case 4: A , B , adjoint_a=True, adjoint_b=True --> (A.T * B.T).T
+ #
+ # Topi implementation for sparse_dense(matmul) has 2 possible input
+ # combination where first input(A) is always dense
+ # and second input(B) is always sparse.
+ # Case 1: A , B, sparse_lhs = False --> A * B.T
+ # Case 2: A , B, sparse_lhs = True --> B * A.T
+ #
+ # The mapping would be as below:
+ # TF Case 1: A , B , adjoint_a=False, adjoint_b=False
Review comment:
I think the implicit part is hard to understand unless you've written this code or thought about it a lot.
##########
File path: python/tvm/relay/frontend/tensorflow.py
##########
@@ -941,8 +934,47 @@ def _impl(inputs, attr, params, mod):
(values_tensor, (rows, cols)), shape=tuple(dense_shape_tensor.tolist())
)
- if sparse_lhs:
+ # As per tensorflow implementation, we have 4 possible input combination
+ # and the first input(A) is always sparse and second input(B) is always dense.
+ # Case 1: A , B , adjoint_a=False, adjoint_b=False --> A * B
+ # Case 2: A , B , adjoint_a=True, adjoint_b=False --> A.T * B
+ # Case 3: A , B , adjoint_a=False, adjoint_b=True --> A * B.T
+ # Case 4: A , B , adjoint_a=True, adjoint_b=True --> (A.T * B.T).T
+ #
+ # Topi implementation for sparse_dense(matmul) has 2 possible input
+ # combination where first input(A) is always dense
+ # and second input(B) is always sparse.
+ # Case 1: A , B, sparse_lhs = False --> A * B.T
+ # Case 2: A , B, sparse_lhs = True --> B * A.T
+ #
+ # The mapping would be as below:
+ # TF Case 1: A , B , adjoint_a=False, adjoint_b=False
+ # --> sparse_dense(transpose(B), A, sparse_lhs=True)
+ #
+ # TF Case 2: A , B , adjoint_a=True, adjoint_b=False
+ # --> sparse_dense(transpose(B), transpose(A), sparse_lhs=True)
+ #
+ # TF Case 3: A , B , adjoint_a=False, adjoint_b=True
+ # --> sparse_dense(B, A, sparse_lhs=True)
+ #
+ # TF Case 4: A , B , adjoint_a=True, adjoint_b=True
+ # --> transpose(sparse_dense(B, transpose(A), sparse_lhs=False))
+
+ # By default, in tensorflow the first input ,i.e., data is sparse
+ sparse_lhs = True
+
+ # TF Case 1:
+ if not attr.get("adjoint_a") and not attr.get("adjoint_b"):
+ data = _op.transpose(data)
+ # TF Case 2:
+ elif attr.get("adjoint_a") and not attr.get("adjoint_b"):
data = _op.transpose(data)
+ weight_sp = csr_matrix(weight_sp.transpose())
+ # TF Case 3:
+ elif not attr.get("adjoint_a") and attr.get("adjoint_b"):
+ pass
+ # TF Case 4:
+ # attr.get("adjoint_a") and attr.get("adjoint_b"):
else:
weight_sp = csr_matrix(weight_sp.transpose())
Review comment:
I think you are missing a `sparse_lhs=False` here.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org