Skip to content
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

quaternion matmul function #694

Open
csbrown opened this issue Sep 5, 2022 · 1 comment
Open

quaternion matmul function #694

csbrown opened this issue Sep 5, 2022 · 1 comment

Comments

@csbrown
Copy link

csbrown commented Sep 5, 2022

Would be nice to have a matmul function in the quaternion library. I'm willing to implement and emulate the existing style in the quaternion library.

Something like:


def matmul(quaternion1: type_alias.TensorLike,
             quaternion2: type_alias.TensorLike,
             name: str = "quaternion_matmul"
             ) -> tf.Tensor:
  """Multiplies matrices of quaternions.
  Note:
    In the following, A1 to An are optional batch dimensions.
  Args:
    quaternion1:  A tensor of shape `[A1, ..., An, M1, M2, 4]`, where M1 and M2 are the matrix dimensions, and the last dimension
      represents a quaternion.
    quaternion2:  A tensor of shape `[A1, ..., An, M2, M3, 4]`, where M2 and M3 are the matrix dimensions, and the last dimension
      represents a quaternion.
    name: A name for this op that defaults to "quaternion_matmul".
  Returns:
    A tensor of shape `[A1, ..., An, M1, M3, 4]` representing matrices of quaternions.
  Raises:
    ValueError: If the shape of `quaternion1` or `quaternion2` is not supported.
  """
@csbrown
Copy link
Author

csbrown commented Sep 5, 2022

Any support for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant