Koleksiyonlar ile düzeninizi koruyun
İçeriği tercihlerinize göre kaydedin ve kategorilere ayırın.
#include <random_ops.h>
Tekdüze bir dağılımdan rastgele tamsayılar çıkarır.
Özet
Üretilen değerler [minval, maxval)
aralığındaki tekdüze tamsayılardır. Alt sınır minval
aralığa dahil edilirken üst sınır maxval
hariç tutulur.
Rastgele tamsayılar, maxval - minval
ikinin tam katı olmadığı sürece biraz önyargılıdır. maxval - minval
değerleri için önyargı küçüktür (ya 2^32
ya da 2^64
).
Argümanlar:
- kapsam: Bir Kapsam nesnesi
- şekil: Çıkış tensörünün şekli.
- minimum değer: 0-D. Oluşturulan tam sayıların kapsayıcı alt sınırı.
- maksimum değer: 0-D. Oluşturulan tam sayılara özel üst sınır.
İsteğe bağlı özellikler (bkz. Attrs
):
- tohum:
seed
veya seed2
biri sıfırdan farklı olarak ayarlanırsa, rastgele sayı üreteci verilen tohum tarafından tohumlanır. Aksi takdirde rastgele bir tohumla tohumlanır. - tohum2: Tohum çarpışmasını önlemek için ikinci bir tohum.
İade:
-
Output
: Düzgün rastgele tamsayılarla doldurulmuş, belirtilen şekle sahip bir tensör.
Genel statik işlevler |
---|
Seed (int64 x) | |
Seed2 (int64 x) | |
Genel özellikler
Kamu işlevleri
Genel statik işlevler
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::RandomUniformInt Class Reference\n\ntensorflow::ops::RandomUniformInt\n=================================\n\n`#include \u003crandom_ops.h\u003e`\n\nOutputs random integers from a uniform distribution.\n\nSummary\n-------\n\nThe generated values are uniform integers in the range `[minval, maxval)`. The lower bound `minval` is included in the range, while the upper bound `maxval` is excluded.\n\nThe random integers are slightly biased unless `maxval - minval` is an exact power of two. The bias is small for values of `maxval - minval` significantly smaller than the range of the output (either `2^32` or `2^64`).\n\nArguments:\n\n- scope: A [Scope](/versions/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- shape: The shape of the output tensor.\n- minval: 0-D. Inclusive lower bound on the generated integers.\n- maxval: 0-D. Exclusive upper bound on the generated integers.\n\n\u003cbr /\u003e\n\nOptional attributes (see [Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/random-uniform-int/attrs#structtensorflow_1_1ops_1_1_random_uniform_int_1_1_attrs)):\n\n- seed: If either `seed` or `seed2` are set to be non-zero, the random number generator is seeded by the given seed. Otherwise, it is seeded by a random seed.\n- seed2: A second seed to avoid seed collision.\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r1.15/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output): A tensor of the specified shape filled with uniform random integers.\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [RandomUniformInt](#classtensorflow_1_1ops_1_1_random_uniform_int_1a7b0f0233dbf65c942cf3918e6d82450f)`(const ::`[tensorflow::Scope](/versions/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` shape, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` minval, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` maxval)` ||\n| [RandomUniformInt](#classtensorflow_1_1ops_1_1_random_uniform_int_1ae9a8b67a0592c64aeadb9c28b8c94d11)`(const ::`[tensorflow::Scope](/versions/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` shape, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` minval, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` maxval, const `[RandomUniformInt::Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/random-uniform-int/attrs#structtensorflow_1_1ops_1_1_random_uniform_int_1_1_attrs)` & attrs)` ||\n\n| ### Public attributes ||\n|------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_random_uniform_int_1a71afc20cf5a867f5f4e616265fbdc245) | [Operation](/versions/r1.15/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [output](#classtensorflow_1_1ops_1_1_random_uniform_int_1ac0cdf1a4f133d9b49df247840a40ff7f) | `::`[tensorflow::Output](/versions/r1.15/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n\n| ### Public functions ||\n|------------------------------------------------------------------------------------------------------------------------------|------------------------|\n| [node](#classtensorflow_1_1ops_1_1_random_uniform_int_1a49b64e7338480155d405c8857052dba8)`() const ` | `::tensorflow::Node *` |\n| [operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_random_uniform_int_1ab20d5478b1e7f66bec1208d955bc485f)`() const ` | ` ` ` ` |\n| [operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_random_uniform_int_1a3a4c37bc4f79b459f17c8d6d01e4024c)`() const ` | ` ` ` ` |\n\n| ### Public static functions ||\n|-------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------|\n| [Seed](#classtensorflow_1_1ops_1_1_random_uniform_int_1a62449aa6617d6d92891fbd702315d3d6)`(int64 x)` | [Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/random-uniform-int/attrs#structtensorflow_1_1ops_1_1_random_uniform_int_1_1_attrs) |\n| [Seed2](#classtensorflow_1_1ops_1_1_random_uniform_int_1a88e15830d1509a59f35301ecfe8aee1c)`(int64 x)` | [Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/random-uniform-int/attrs#structtensorflow_1_1ops_1_1_random_uniform_int_1_1_attrs) |\n\n| ### Structs ||\n|------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [tensorflow::ops::RandomUniformInt::Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/random-uniform-int/attrs) | Optional attribute setters for [RandomUniformInt](/versions/r1.15/api_docs/cc/class/tensorflow/ops/random-uniform-int#classtensorflow_1_1ops_1_1_random_uniform_int). |\n\nPublic attributes\n-----------------\n\n### operation\n\n```text\nOperation operation\n``` \n\n### output\n\n```text\n::tensorflow::Output output\n``` \n\nPublic functions\n----------------\n\n### RandomUniformInt\n\n```gdscript\n RandomUniformInt(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input shape,\n ::tensorflow::Input minval,\n ::tensorflow::Input maxval\n)\n``` \n\n### RandomUniformInt\n\n```gdscript\n RandomUniformInt(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input shape,\n ::tensorflow::Input minval,\n ::tensorflow::Input maxval,\n const RandomUniformInt::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### Seed\n\n```text\nAttrs Seed(\n int64 x\n)\n``` \n\n### Seed2\n\n```text\nAttrs Seed2(\n int64 x\n)\n```"]]