Stay organized with collections
Save and categorize content based on your preferences.
tensorflow::ops::FusedResizeAndPadConv2D
#include <nn_ops.h>
Performs a resize and padding as a preprocess during a convolution.
Summary
It's often possible to do spatial transformations more efficiently as part of the packing stage of a convolution, so this op allows for an optimized implementation where these stages are fused together. This prevents the need to write out the intermediate results as whole tensors, reducing memory pressure, and we can get some latency gains by merging the transformation calculations. The data_format attribute for Conv2D isn't supported by this op, and defaults to 'NHWC' order. Internally this op uses a single per-graph scratch buffer, which means that it will block if multiple versions are being run in parallel. This is because this operator is primarily an optimization to minimize memory usage.
Args:
- scope: A Scope object
- input: 4-D with shape
[batch, in_height, in_width, in_channels]
.
- size: A 1-D int32 Tensor of 2 elements:
new_height, new_width
. The new size for the images.
- paddings: A two-column matrix specifying the padding sizes. The number of rows must be the same as the rank of
input
.
- filter: 4-D with shape
[filter_height, filter_width, in_channels, out_channels]
.
- strides: 1-D of length 4. The stride of the sliding window for each dimension of
input
. Must be in the same order as the dimension specified with format.
- padding: The type of padding algorithm to use.
Optional attributes (see Attrs
):
- resize_align_corners: If true, the centers of the 4 corner pixels of the input and output tensors are aligned, preserving the values at the corner pixels. Defaults to false.
Returns:
Constructors and Destructors
|
FusedResizeAndPadConv2D(const ::tensorflow::Scope & scope, ::tensorflow::Input input, ::tensorflow::Input size, ::tensorflow::Input paddings, ::tensorflow::Input filter, StringPiece mode, const gtl::ArraySlice< int > & strides, StringPiece padding)
|
FusedResizeAndPadConv2D(const ::tensorflow::Scope & scope, ::tensorflow::Input input, ::tensorflow::Input size, ::tensorflow::Input paddings, ::tensorflow::Input filter, StringPiece mode, const gtl::ArraySlice< int > & strides, StringPiece padding, const FusedResizeAndPadConv2D::Attrs & attrs)
|
Public attributes
Public functions
node
::tensorflow::Node * node() const
operator::tensorflow::Input() const
operator::tensorflow::Output
operator::tensorflow::Output() const
Public static functions
ResizeAlignCorners
Attrs ResizeAlignCorners(
bool x
)
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. Some content is licensed under the numpy license.
Last updated 2023-10-06 UTC.
[null,null,["Last updated 2023-10-06 UTC."],[],[],null,["# tensorflow::ops::FusedResizeAndPadConv2D Class Reference\n\ntensorflow::ops::FusedResizeAndPadConv2D\n========================================\n\n`#include \u003cnn_ops.h\u003e`\n\nPerforms a resize and padding as a preprocess during a convolution.\n\nSummary\n-------\n\nIt's often possible to do spatial transformations more efficiently as part of the packing stage of a convolution, so this op allows for an optimized implementation where these stages are fused together. This prevents the need to write out the intermediate results as whole tensors, reducing memory pressure, and we can get some latency gains by merging the transformation calculations. The data_format attribute for [Conv2D](/versions/r2.14/api_docs/cc/class/tensorflow/ops/conv2-d#classtensorflow_1_1ops_1_1_conv2_d) isn't supported by this op, and defaults to 'NHWC' order. Internally this op uses a single per-graph scratch buffer, which means that it will block if multiple versions are being run in parallel. This is because this operator is primarily an optimization to minimize memory usage.\n\nArgs:\n\n- scope: A [Scope](/versions/r2.14/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- input: 4-D with shape `[batch, in_height, in_width, in_channels]`.\n- size: A 1-D int32 [Tensor](/versions/r2.14/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor) of 2 elements: `new_height, new_width`. The new size for the images.\n- paddings: A two-column matrix specifying the padding sizes. The number of rows must be the same as the rank of `input`.\n- filter: 4-D with shape `[filter_height, filter_width, in_channels, out_channels]`.\n- strides: 1-D of length 4. The stride of the sliding window for each dimension of `input`. Must be in the same order as the dimension specified with format.\n- padding: The type of padding algorithm to use.\n\n\u003cbr /\u003e\n\nOptional attributes (see [Attrs](/versions/r2.14/api_docs/cc/struct/tensorflow/ops/fused-resize-and-pad-conv2-d/attrs#structtensorflow_1_1ops_1_1_fused_resize_and_pad_conv2_d_1_1_attrs)):\n\n- resize_align_corners: If true, the centers of the 4 corner pixels of the input and output tensors are aligned, preserving the values at the corner pixels. Defaults to false.\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r2.14/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output): The output tensor.\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [FusedResizeAndPadConv2D](#classtensorflow_1_1ops_1_1_fused_resize_and_pad_conv2_d_1afdac6e55ba14082f1b161c3892feb79c)`(const ::`[tensorflow::Scope](/versions/r2.14/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.14/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` input, ::`[tensorflow::Input](/versions/r2.14/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` size, ::`[tensorflow::Input](/versions/r2.14/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` paddings, ::`[tensorflow::Input](/versions/r2.14/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` filter, StringPiece mode, const gtl::ArraySlice\u003c int \u003e & strides, StringPiece padding)` ||\n| [FusedResizeAndPadConv2D](#classtensorflow_1_1ops_1_1_fused_resize_and_pad_conv2_d_1ab05dac1d726214f232015fa7696ee523)`(const ::`[tensorflow::Scope](/versions/r2.14/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.14/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` input, ::`[tensorflow::Input](/versions/r2.14/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` size, ::`[tensorflow::Input](/versions/r2.14/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` paddings, ::`[tensorflow::Input](/versions/r2.14/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` filter, StringPiece mode, const gtl::ArraySlice\u003c int \u003e & strides, StringPiece padding, const `[FusedResizeAndPadConv2D::Attrs](/versions/r2.14/api_docs/cc/struct/tensorflow/ops/fused-resize-and-pad-conv2-d/attrs#structtensorflow_1_1ops_1_1_fused_resize_and_pad_conv2_d_1_1_attrs)` & attrs)` ||\n\n| ### Public attributes ||\n|----------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_fused_resize_and_pad_conv2_d_1a452db77c1530086287369d18c4e67196) | [Operation](/versions/r2.14/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [output](#classtensorflow_1_1ops_1_1_fused_resize_and_pad_conv2_d_1ad8619b45c03b5aa399ef784c4b5d96a5) | `::`[tensorflow::Output](/versions/r2.14/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n\n| ### Public functions ||\n|----------------------------------------------------------------------------------------------------------------------------------------|------------------------|\n| [node](#classtensorflow_1_1ops_1_1_fused_resize_and_pad_conv2_d_1ad006395b5772a9dad02d7e8aec083755)`() const ` | `::tensorflow::Node *` |\n| [operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_fused_resize_and_pad_conv2_d_1ad64d511881de03b3de360bc2d09af397)`() const ` | |\n| [operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_fused_resize_and_pad_conv2_d_1a0ae5c811852f315f2b5cc87682ca69a3)`() const ` | |\n\n| ### Public static functions ||\n|-----------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [ResizeAlignCorners](#classtensorflow_1_1ops_1_1_fused_resize_and_pad_conv2_d_1a26a1da31c5f264b43033f67ce65063c0)`(bool x)` | [Attrs](/versions/r2.14/api_docs/cc/struct/tensorflow/ops/fused-resize-and-pad-conv2-d/attrs#structtensorflow_1_1ops_1_1_fused_resize_and_pad_conv2_d_1_1_attrs) |\n\n| ### Structs ||\n|-----------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [tensorflow::ops::FusedResizeAndPadConv2D::Attrs](/versions/r2.14/api_docs/cc/struct/tensorflow/ops/fused-resize-and-pad-conv2-d/attrs) | Optional attribute setters for [FusedResizeAndPadConv2D](/versions/r2.14/api_docs/cc/class/tensorflow/ops/fused-resize-and-pad-conv2-d#classtensorflow_1_1ops_1_1_fused_resize_and_pad_conv2_d). |\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### FusedResizeAndPadConv2D\n\n```gdscript\n FusedResizeAndPadConv2D(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input input,\n ::tensorflow::Input size,\n ::tensorflow::Input paddings,\n ::tensorflow::Input filter,\n StringPiece mode,\n const gtl::ArraySlice\u003c int \u003e & strides,\n StringPiece padding\n)\n``` \n\n### FusedResizeAndPadConv2D\n\n```gdscript\n FusedResizeAndPadConv2D(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input input,\n ::tensorflow::Input size,\n ::tensorflow::Input paddings,\n ::tensorflow::Input filter,\n StringPiece mode,\n const gtl::ArraySlice\u003c int \u003e & strides,\n StringPiece padding,\n const FusedResizeAndPadConv2D::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### ResizeAlignCorners\n\n```text\nAttrs ResizeAlignCorners(\n bool x\n)\n```"]]