# tf_agents.specs.tensor_spec.to_pbtxt_file

<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#L618-L624) |

Saves a spec encoded as a struct_pb2.StructuredValue in a pbtxt file.

    tf_agents.specs.tensor_spec.to_pbtxt_file(
        output_path, spec
    )