# tf.contrib.training.byte_size_load_fn

<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/training/python/training/device_setter.py#L105-L136) |

Load function that computes the byte size of a single-output `Operation`.

    tf.contrib.training.byte_size_load_fn(
        op
    )

This is intended to be used with `"Variable"` ops, which have a single
`Tensor` output with the contents of the variable. However, it can also be
used for calculating the size of any op that has a single output.

Intended to be used with `GreedyLoadBalancingStrategy`.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `op` | An `Operation` with a single output, typically a "Variable" op. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| The number of bytes in the output `Tensor`. ||

<br />

<br />

<br />

<br />

| ## Raises ||
|---|---|
| `ValueError` | if `op` does not have a single output, or if the shape of the single output is not fully-defined. |

<br />