From 05d7dc276a0c751c5e65656d66a1efebb50cf224 Mon Sep 17 00:00:00 2001 From: dorbit Date: Fri, 28 Nov 2025 21:19:09 +0200 Subject: [PATCH] Fix NestedTensor deprecation warning in SDPA tutorial Add layout=torch.jagged parameter to nested_tensor call to suppress the prototype API warning and use the recommended jagged layout. --- intermediate_source/scaled_dot_product_attention_tutorial.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/intermediate_source/scaled_dot_product_attention_tutorial.py b/intermediate_source/scaled_dot_product_attention_tutorial.py index 35b1ba7be4e..6b67169e7e1 100644 --- a/intermediate_source/scaled_dot_product_attention_tutorial.py +++ b/intermediate_source/scaled_dot_product_attention_tutorial.py @@ -223,7 +223,7 @@ def generate_rand_batch( torch.randn(seq_len, embed_dimension, dtype=dtype, device=device) for seq_len in seq_len_list - ] + ], layout=torch.jagged ), seq_len_list, )