---
title: thunder.core.trace.set_tracectx
description: Sets the current trace context.
canonical: >-
  https://lightning.ai/docs/thunder/stable/api-reference/generated/thunder.core.trace.set_tracectx
---
# thunder.core.trace.set_tracectx {#thunder-core-trace-set-tracectx}

### `thunder.core.trace.set_tracectx(ctx)` {#thunder.core.trace.set_tracectx}

[\[source\]](https://github.com/Lightning-AI/lightning-thunder/blob/0.2.6/thunder/core/trace.py#L539-L542)

Sets the current trace context.

---

**Navigation**

- Parent: [Generated](/docs/thunder/0.2.6/api-reference/generated.md)
