# tf.contrib.receptive_field.get_compute_order

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/contrib/receptive_field/python/util/graph_compute_order.py#L160-L192) |

Computes order of computation for a given CNN graph.

    tf.contrib.receptive_field.get_compute_order(
        graph_def, input_node_name='', input_node_size=None
    )

Optionally, the function may also compute the input and output feature map
resolutions at each node. In this case, input_node_name and input_node_size
must be set. Note that if a node's op type is unknown, the input and output
resolutions are ignored and set to None.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `graph_def` | GraphDef object. |
| `input_node_name` | Name of node with fixed input resolution (optional). This is usually the node name for the input image in a CNN. |
| `input_node_size` | 2D list of integers, fixed input resolution to use (optional). This is usually the input resolution used for the input image in a CNN (common examples are: \[224, 224\], \[299, 299\], \[321, 321\]). |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| `node_info` | Default dict keyed by node name, mapping to a named tuple with the following fields: <br /> - order: Integer denoting topological order; - node: NodeDef for the given node; - input_size: 2D list of integers, denoting the input spatial resolution to the node; - output_size: 2D list of integers, denoting the output spatial resolution of the node. |
| `name_to_node` | Dict keyed by node name, each entry containing the node's NodeDef. |