# tf_agents.specs.tensor_spec.to_proto

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/specs/tensor_spec.py#L591-L603) |

Encodes a nested spec into a struct_pb2.StructuredValue proto.

    tf_agents.specs.tensor_spec.to_proto(
        spec
    )

<br />

<br />

<br />

| ## Args ||
|---|---|
| `spec` | Nested list/tuple or dict of TensorSpecs, describing the shape of the non-batched Tensors. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A `struct_pb2.StructuredValue` proto. ||

<br />