tfp.math.sparse_or_dense_matmul
Stay organized with collections
Save and categorize content based on your preferences.
Returns (batched) matmul of a SparseTensor (or Tensor) with a Tensor.
tfp.math.sparse_or_dense_matmul(
sparse_or_dense_a, dense_b, validate_args=False, name=None, **kwargs
)
Args |
sparse_or_dense_a
|
SparseTensor or Tensor representing a (batch of)
matrices.
|
dense_b
|
Tensor representing a (batch of) matrices, with the same batch
shape as sparse_or_dense_a . The shape must be compatible with the shape
of sparse_or_dense_a and kwargs.
|
validate_args
|
When True , additional assertions might be embedded in the
graph.
Default value: False (i.e., no graph assertions are added).
|
name
|
Python str prefixed to ops created by this function.
Default value: 'sparse_or_dense_matmul'.
|
**kwargs
|
Keyword arguments to tf.sparse_tensor_dense_matmul or
tf.matmul .
|
Returns |
product
|
A dense (batch of) matrix-shaped Tensor of the same batch shape and
dtype as sparse_or_dense_a and dense_b . If sparse_or_dense_a or
dense_b is adjointed through kwargs then the shape is adjusted
accordingly.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2023-11-21 UTC.
[null,null,["Last updated 2023-11-21 UTC."],[],[],null,["# tfp.math.sparse_or_dense_matmul\n\n\u003cbr /\u003e\n\n|----------------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/probability/blob/v0.23.0/tensorflow_probability/python/math/linalg.py#L837-L885) |\n\nReturns (batched) matmul of a SparseTensor (or Tensor) with a Tensor. \n\n tfp.math.sparse_or_dense_matmul(\n sparse_or_dense_a, dense_b, validate_args=False, name=None, **kwargs\n )\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|---------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `sparse_or_dense_a` | `SparseTensor` or `Tensor` representing a (batch of) matrices. |\n| `dense_b` | `Tensor` representing a (batch of) matrices, with the same batch shape as `sparse_or_dense_a`. The shape must be compatible with the shape of `sparse_or_dense_a` and kwargs. |\n| `validate_args` | When `True`, additional assertions might be embedded in the graph. Default value: `False` (i.e., no graph assertions are added). |\n| `name` | Python `str` prefixed to ops created by this function. Default value: 'sparse_or_dense_matmul'. |\n| `**kwargs` | Keyword arguments to `tf.sparse_tensor_dense_matmul` or [`tf.matmul`](https://www.tensorflow.org/api_docs/python/tf/linalg/matmul). |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|-----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `product` | A dense (batch of) matrix-shaped Tensor of the same batch shape and dtype as `sparse_or_dense_a` and `dense_b`. If `sparse_or_dense_a` or `dense_b` is adjointed through `kwargs` then the shape is adjusted accordingly. |\n\n\u003cbr /\u003e"]]