Koleksiyonlar ile düzeninizi koruyun
İçeriği tercihlerinize göre kaydedin ve kategorilere ayırın.
tensor akışı:: işlem:: Cumprod
#include <math_ops.h>
Tensör x
axis
boyunca kümülatif çarpımını hesaplayın.
Özet
Varsayılan olarak bu op, kapsayıcı bir cumprod gerçekleştirir; bu, girişin ilk öğesinin çıkışın ilk öğesiyle aynı olduğu anlamına gelir:
tf.cumprod([a, b, c]) # => [a, a * b, a * b * c]
exclusive
kwarg'ı True
olarak ayarladığınızda bunun yerine özel bir cumprod gerçekleştirilir:
tf.cumprod([a, b, c], exclusive=True) # => [1, a, a * b]
reverse
kwarg'ı True
olarak ayarladığınızda cumprod ters yönde gerçekleştirilir:
tf.cumprod([a, b, c], reverse=True) # => [a * b * c, b * c, c]
Bu, ayrı tf.reverse
operasyonlarını kullanmaktan daha verimlidir.
reverse
ve exclusive
kwarglar da birleştirilebilir:
tf.cumprod([a, b, c], exclusive=True, reverse=True) # => [b * c, c, 1]
Argümanlar:
- kapsam: Bir Kapsam nesnesi
- x: Bir
Tensor
. Şu türlerden biri olmalıdır: float32
, float64
, int64
, int32
, uint8
, uint16
, int16
, int8
, complex64
, complex128
, qint8
, quint8
, qint32
, half
. - eksen:
int32
türünde bir Tensor
(varsayılan: 0). [-rank(x), rank(x))
aralığında olmalıdır.
İsteğe bağlı özellikler (bkz. Attrs
):
- özel:
True
ise özel cumprod gerçekleştirin. - ters: Bir
bool
(varsayılan: Yanlış).
İade:
Genel özellikler
Kamu işlevleri
düğüm
::tensorflow::Node * node() const
operator::tensorflow::Input() const
operatör::tensorflow::Çıktı
operator::tensorflow::Output() const
Genel statik işlevler
Özel
Attrs Exclusive(
bool x
)
Tersi
Attrs Reverse(
bool x
)
Aksi belirtilmediği sürece bu sayfanın içeriği Creative Commons Atıf 4.0 Lisansı altında ve kod örnekleri Apache 2.0 Lisansı altında lisanslanmıştır. Ayrıntılı bilgi için Google Developers Site Politikaları'na göz atın. Java, Oracle ve/veya satış ortaklarının tescilli ticari markasıdır.
Son güncelleme tarihi: 2025-07-26 UTC.
[null,null,["Son güncelleme tarihi: 2025-07-26 UTC."],[],[],null,["# tensorflow::ops::Cumprod Class Reference\n\ntensorflow::ops::Cumprod\n========================\n\n`#include \u003cmath_ops.h\u003e`\n\nCompute the cumulative product of the tensor `x` along `axis`.\n\nSummary\n-------\n\nBy default, this op performs an inclusive cumprod, which means that the first element of the input is identical to the first element of the output:\n\n\n```scdoc\ntf.cumprod([a, b, c]) # =\u003e [a, a * b, a * b * c]\n```\n\n\u003cbr /\u003e\n\nBy setting the `exclusive` kwarg to `True`, an exclusive cumprod is performed instead:\n\n\n```scdoc\ntf.cumprod([a, b, c], exclusive=True) # =\u003e [1, a, a * b]\n```\n\n\u003cbr /\u003e\n\nBy setting the `reverse` kwarg to `True`, the cumprod is performed in the opposite direction:\n\n\n```scdoc\ntf.cumprod([a, b, c], reverse=True) # =\u003e [a * b * c, b * c, c]\n```\n\n\u003cbr /\u003e\n\nThis is more efficient than using separate `tf.reverse` ops.\n\nThe `reverse` and `exclusive` kwargs can also be combined:\n\n\n```scdoc\ntf.cumprod([a, b, c], exclusive=True, reverse=True) # =\u003e [b * c, c, 1]\n```\n\n\u003cbr /\u003e\n\nArguments:\n\n- scope: A [Scope](/versions/r2.1/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- x: A [Tensor](/versions/r2.1/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor). Must be one of the following types: `float32`, `float64`, `int64`, `int32`, `uint8`, `uint16`, `int16`, `int8`, `complex64`, `complex128`, `qint8`, `quint8`, `qint32`, `half`.\n- axis: A [Tensor](/versions/r2.1/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor) of type `int32` (default: 0). Must be in the range `[-rank(x), rank(x))`.\n\n\u003cbr /\u003e\n\nOptional attributes (see [Attrs](/versions/r2.1/api_docs/cc/struct/tensorflow/ops/cumprod/attrs#structtensorflow_1_1ops_1_1_cumprod_1_1_attrs)):\n\n- exclusive: If `True`, perform exclusive cumprod.\n- reverse: A `bool` (default: False).\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r2.1/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output): The out tensor.\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [Cumprod](#classtensorflow_1_1ops_1_1_cumprod_1a5cf5eb762b0a395c784265be34cefca9)`(const ::`[tensorflow::Scope](/versions/r2.1/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.1/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` x, ::`[tensorflow::Input](/versions/r2.1/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` axis)` ||\n| [Cumprod](#classtensorflow_1_1ops_1_1_cumprod_1af028aab7f34ea1aba5dd296b8cb2fdbc)`(const ::`[tensorflow::Scope](/versions/r2.1/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.1/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` x, ::`[tensorflow::Input](/versions/r2.1/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` axis, const `[Cumprod::Attrs](/versions/r2.1/api_docs/cc/struct/tensorflow/ops/cumprod/attrs#structtensorflow_1_1ops_1_1_cumprod_1_1_attrs)` & attrs)` ||\n\n| ### Public attributes ||\n|-------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_cumprod_1a15918749b2c6a95b59853778fb5a449e) | [Operation](/versions/r2.1/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [out](#classtensorflow_1_1ops_1_1_cumprod_1a993dbcb13834ecd895a4009ba5bdfb48) | `::`[tensorflow::Output](/versions/r2.1/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n\n| ### Public functions ||\n|-------------------------------------------------------------------------------------------------------------------|------------------------|\n| [node](#classtensorflow_1_1ops_1_1_cumprod_1abd920e1da9ceb0d441bb10250cc860cd)`() const ` | `::tensorflow::Node *` |\n| [operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_cumprod_1adc26a397e6b980247abf7fd333c0f389)`() const ` | ` ` ` ` |\n| [operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_cumprod_1acab6e7e1ab4245028ef1b8625859757a)`() const ` | ` ` ` ` |\n\n| ### Public static functions ||\n|-----------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------|\n| [Exclusive](#classtensorflow_1_1ops_1_1_cumprod_1aa8984f96042955a9b2c08528a49df924)`(bool x)` | [Attrs](/versions/r2.1/api_docs/cc/struct/tensorflow/ops/cumprod/attrs#structtensorflow_1_1ops_1_1_cumprod_1_1_attrs) |\n| [Reverse](#classtensorflow_1_1ops_1_1_cumprod_1aafe8da11faadd6cca28c310fac8aec6d)`(bool x)` | [Attrs](/versions/r2.1/api_docs/cc/struct/tensorflow/ops/cumprod/attrs#structtensorflow_1_1ops_1_1_cumprod_1_1_attrs) |\n\n| ### Structs ||\n|---------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------|\n| [tensorflow::ops::Cumprod::Attrs](/versions/r2.1/api_docs/cc/struct/tensorflow/ops/cumprod/attrs) | Optional attribute setters for [Cumprod](/versions/r2.1/api_docs/cc/class/tensorflow/ops/cumprod#classtensorflow_1_1ops_1_1_cumprod). |\n\nPublic attributes\n-----------------\n\n### operation\n\n```text\nOperation operation\n``` \n\n### out\n\n```text\n::tensorflow::Output out\n``` \n\nPublic functions\n----------------\n\n### Cumprod\n\n```gdscript\n Cumprod(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input x,\n ::tensorflow::Input axis\n)\n``` \n\n### Cumprod\n\n```gdscript\n Cumprod(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input x,\n ::tensorflow::Input axis,\n const Cumprod::Attrs & attrs\n)\n``` \n\n### node\n\n```gdscript\n::tensorflow::Node * node() const \n``` \n\n### operator::tensorflow::Input\n\n```gdscript\n operator::tensorflow::Input() const \n``` \n\n### operator::tensorflow::Output\n\n```gdscript\n operator::tensorflow::Output() const \n``` \n\nPublic static functions\n-----------------------\n\n### Exclusive\n\n```text\nAttrs Exclusive(\n bool x\n)\n``` \n\n### Reverse\n\n```text\nAttrs Reverse(\n bool x\n)\n```"]]