تينسورفلو :: العمليات :: قسم ديناميكي
#include <data_flow_ops.h>
num_partitions
data
إلى num_partitions
موتر باستخدام مؤشرات من partitions
.
ملخص
لكل مجموعة فهرس js
من size partitions.ndim
، تصبح data[js, ...]
الشريحة data[js, ...]
جزءًا من outputs[partitions[js]]
. الشرائح ذات partitions[js] = i
موضوعة في outputs[i]
بترتيب معجمي لـ js
، والبعد الأول outputs[i]
هو عدد الإدخالات في partitions
تساوي i
. بالتفصيل،
outputs[i].shape = [sum(partitions == i)] + data.shape[partitions.ndim:]
outputs[i] = pack([data[js, ...] for js if partitions[js] == i])
يجب أن يبدأ data.shape
بـ partitions.shape
.
على سبيل المثال:
# Scalar partitions. partitions = 1 num_partitions = 2 data = [10, 20] outputs[0] = [] # Empty with shape [0, 2] outputs[1] = [[10, 20]]
# Vector partitions. partitions = [0, 0, 1, 1, 0] num_partitions = 2 data = [10, 20, 30, 40, 50] outputs[0] = [10, 20, 50] outputs[1] = [30, 40]
راجع dynamic_stitch
للحصول على مثال حول كيفية دمج الأقسام مرة أخرى.
الحجج:
- النطاق: كائن النطاق
- أقسام: أي شكل. الفهارس في النطاق
[0, num_partitions)
. - num_partitions: عدد الأقسام المراد إخراجها.
عائدات:
-
OutputList
: موتر المخرجات.
البنائين والمدمرين | |
---|---|
DynamicPartition (const :: tensorflow::Scope & scope, :: tensorflow::Input data, :: tensorflow::Input partitions, int64 num_partitions) |
السمات العامة | |
---|---|
operation | |
outputs |
الوظائف العامة | |
---|---|
operator[] (size_t index) const |
السمات العامة
عملية
Operation operation
النواتج
::tensorflow::OutputList outputs
الوظائف العامة
قسم ديناميكي
DynamicPartition( const ::tensorflow::Scope & scope, ::tensorflow::Input data, ::tensorflow::Input partitions, int64 num_partitions )
المشغل أو العامل[]
::tensorflow::Output operator[]( size_t index ) const
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 2020-04-20 UTC.