Organízate con las colecciones
Guarda y clasifica el contenido según tus preferencias.
flujo tensor:: operaciones:: ProfundidadConv2dNativo
#include <nn_ops.h>
Calcula una convolución profunda 2D dada input
4D y los tensores filter
.
Resumen
Dado un tensor de entrada de forma [batch, in_height, in_width, in_channels]
y un tensor de filtro/núcleo de forma [filter_height, filter_width, in_channels, channel_multiplier]
, que contiene filtros convolucionales in_channels
de profundidad 1, depthwise_conv2d
aplica un filtro diferente a cada canal de entrada. (expandiéndose de 1 canal a canales channel_multiplier
para cada uno), luego concatena los resultados. Por lo tanto, la salida tiene canales in_channels * channel_multiplier
.
for k in 0..in_channels-1
for q in 0..channel_multiplier-1
output[b, i, j, k * channel_multiplier + q] =
sum_{di, dj} input[b, strides[1] * i + di, strides[2] * j + dj, k] *
filter[di, dj, k, q]
Debe tener strides[0] = strides[3] = 1
. Para el caso más común de las mismas zancadas horizontales y de vértices, strides = [1, stride, stride, 1]
.
Argumentos:
- alcance: un objeto de alcance
- zancadas: 1-D de longitud 4. La zancada de la ventana deslizante para cada dimensión de
input
. - padding: el tipo de algoritmo de relleno que se utilizará.
Atributos opcionales (ver Attrs
):
- data_format: especifique el formato de datos de entrada y salida. Con el formato predeterminado "NHWC", los datos se almacenan en el orden de: [lote, alto, ancho, canales]. Alternativamente, el formato podría ser "NCHW", el orden de almacenamiento de datos de: [lote, canales, alto, ancho].
- dilataciones: tensor 1-D de longitud 4. El factor de dilatación para cada dimensión de
input
. Si se establece en k > 1, se omitirán k-1 celdas entre cada elemento de filtro en esa dimensión. El orden de las dimensiones está determinado por el valor de data_format
; consulte más arriba para obtener más detalles. Las dilataciones en las dimensiones de lote y profundidad deben ser 1.
Devoluciones:
Atributos públicos
Funciones públicas
nodo
::tensorflow::Node * node() const
operator::tensorflow::Input() const
operador::tensorflow::Salida
operator::tensorflow::Output() const
Funciones estáticas públicas
Attrs DataFormat(
StringPiece x
)
dilataciones
Attrs Dilations(
const gtl::ArraySlice< int > & x
)
Rellenos explícitos
Attrs ExplicitPaddings(
const gtl::ArraySlice< int > & x
)
A menos que se indique lo contrario, el contenido de esta página está sujeto a la licencia Reconocimiento 4.0 de Creative Commons y las muestras de código están sujetas a la licencia Apache 2.0. Para obtener más información, consulta las políticas del sitio web de Google Developers. Java es una marca registrada de Oracle o sus afiliados.
Última actualización: 2025-07-27 (UTC).
[null,null,["Última actualización: 2025-07-27 (UTC)."],[],[],null,["# tensorflow::ops::DepthwiseConv2dNative Class Reference\n\ntensorflow::ops::DepthwiseConv2dNative\n======================================\n\n`#include \u003cnn_ops.h\u003e`\n\nComputes a 2-D depthwise convolution given 4-D `input` and `filter` tensors.\n\nSummary\n-------\n\nGiven an input tensor of shape `[batch, in_height, in_width, in_channels]` and a filter / kernel tensor of shape `[filter_height, filter_width, in_channels, channel_multiplier]`, containing `in_channels` convolutional filters of depth 1, `depthwise_conv2d` applies a different filter to each input channel (expanding from 1 channel to `channel_multiplier` channels for each), then concatenates the results together. Thus, the output has `in_channels * channel_multiplier` channels.\n\n\n```scdoc\nfor k in 0..in_channels-1\n for q in 0..channel_multiplier-1\n output[b, i, j, k * channel_multiplier + q] =\n sum_{di, dj} input[b, strides[1] * i + di, strides[2] * j + dj, k] *\n filter[di, dj, k, q]\n```\n\n\u003cbr /\u003e\n\nMust have `strides[0] = strides[3] = 1`. For the most common case of the same horizontal and vertices strides, `strides = [1, stride, stride, 1]`.\n\nArguments:\n\n- scope: A [Scope](/versions/r2.3/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- strides: 1-D of length 4. The stride of the sliding window for each dimension of `input`.\n- padding: The type of padding algorithm to use.\n\n\u003cbr /\u003e\n\nOptional attributes (see [Attrs](/versions/r2.3/api_docs/cc/struct/tensorflow/ops/depthwise-conv2d-native/attrs#structtensorflow_1_1ops_1_1_depthwise_conv2d_native_1_1_attrs)):\n\n- data_format: Specify the data format of the input and output data. With the default format \"NHWC\", the data is stored in the order of: \\[batch, height, width, channels\\]. Alternatively, the format could be \"NCHW\", the data storage order of: \\[batch, channels, height, width\\].\n- dilations: 1-D tensor of length 4. The dilation factor for each dimension of `input`. If set to k \\\u003e 1, there will be k-1 skipped cells between each filter element on that dimension. The dimension order is determined by the value of `data_format`, see above for details. Dilations in the batch and depth dimensions must be 1.\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output): The output tensor.\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [DepthwiseConv2dNative](#classtensorflow_1_1ops_1_1_depthwise_conv2d_native_1a50c225536301350d0a2a4e15f11bb1e8)`(const ::`[tensorflow::Scope](/versions/r2.3/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` input, ::`[tensorflow::Input](/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` filter, const gtl::ArraySlice\u003c int \u003e & strides, StringPiece padding)` ||\n| [DepthwiseConv2dNative](#classtensorflow_1_1ops_1_1_depthwise_conv2d_native_1a1403cd12618eaad516b1e553b99a2dec)`(const ::`[tensorflow::Scope](/versions/r2.3/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` input, ::`[tensorflow::Input](/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` filter, const gtl::ArraySlice\u003c int \u003e & strides, StringPiece padding, const `[DepthwiseConv2dNative::Attrs](/versions/r2.3/api_docs/cc/struct/tensorflow/ops/depthwise-conv2d-native/attrs#structtensorflow_1_1ops_1_1_depthwise_conv2d_native_1_1_attrs)` & attrs)` ||\n\n| ### Public attributes ||\n|-----------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_depthwise_conv2d_native_1af4279f97302c2185f1577d3cee105837) | [Operation](/versions/r2.3/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [output](#classtensorflow_1_1ops_1_1_depthwise_conv2d_native_1a787a2254c323c4cc73067daa11e2b646) | `::`[tensorflow::Output](/versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n\n| ### Public functions ||\n|-----------------------------------------------------------------------------------------------------------------------------------|------------------------|\n| [node](#classtensorflow_1_1ops_1_1_depthwise_conv2d_native_1ab6d86ff41ea2b1ec8b84bd58bda5b4c7)`() const ` | `::tensorflow::Node *` |\n| [operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_depthwise_conv2d_native_1ab08d7fc817e77e96f3d713f9c4536ccd)`() const ` | ` ` ` ` |\n| [operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_depthwise_conv2d_native_1aaa32a9f3e246eae5adc3000f23eb8e88)`() const ` | ` ` ` ` |\n\n| ### Public static functions ||\n|------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [DataFormat](#classtensorflow_1_1ops_1_1_depthwise_conv2d_native_1a51fe0b98bda9604c4dcb4ce5156714df)`(StringPiece x)` | [Attrs](/versions/r2.3/api_docs/cc/struct/tensorflow/ops/depthwise-conv2d-native/attrs#structtensorflow_1_1ops_1_1_depthwise_conv2d_native_1_1_attrs) |\n| [Dilations](#classtensorflow_1_1ops_1_1_depthwise_conv2d_native_1a36765465f25da5bb2ff97249302c8806)`(const gtl::ArraySlice\u003c int \u003e & x)` | [Attrs](/versions/r2.3/api_docs/cc/struct/tensorflow/ops/depthwise-conv2d-native/attrs#structtensorflow_1_1ops_1_1_depthwise_conv2d_native_1_1_attrs) |\n| [ExplicitPaddings](#classtensorflow_1_1ops_1_1_depthwise_conv2d_native_1a73ae4e50791a90681f92a54719605f21)`(const gtl::ArraySlice\u003c int \u003e & x)` | [Attrs](/versions/r2.3/api_docs/cc/struct/tensorflow/ops/depthwise-conv2d-native/attrs#structtensorflow_1_1ops_1_1_depthwise_conv2d_native_1_1_attrs) |\n\n| ### Structs ||\n|---------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [tensorflow::ops::DepthwiseConv2dNative::Attrs](/versions/r2.3/api_docs/cc/struct/tensorflow/ops/depthwise-conv2d-native/attrs) | Optional attribute setters for [DepthwiseConv2dNative](/versions/r2.3/api_docs/cc/class/tensorflow/ops/depthwise-conv2d-native#classtensorflow_1_1ops_1_1_depthwise_conv2d_native). |\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### DepthwiseConv2dNative\n\n```gdscript\n DepthwiseConv2dNative(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input input,\n ::tensorflow::Input filter,\n const gtl::ArraySlice\u003c int \u003e & strides,\n StringPiece padding\n)\n``` \n\n### DepthwiseConv2dNative\n\n```gdscript\n DepthwiseConv2dNative(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input input,\n ::tensorflow::Input filter,\n const gtl::ArraySlice\u003c int \u003e & strides,\n StringPiece padding,\n const DepthwiseConv2dNative::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### DataFormat\n\n```text\nAttrs DataFormat(\n StringPiece x\n)\n``` \n\n### Dilations\n\n```gdscript\nAttrs Dilations(\n const gtl::ArraySlice\u003c int \u003e & x\n)\n``` \n\n### ExplicitPaddings\n\n```gdscript\nAttrs ExplicitPaddings(\n const gtl::ArraySlice\u003c int \u003e & x\n)\n```"]]