You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importtorch.nnasnnimporttorch.optimasoptimimporttorchmetricsfromcustom_loss_copyimportKmeans_Supervised_Contrastive_Losscustom_criterion=Kmeans_Supervised_Contrastive_Loss(10,3,200,device)
criterion=nn.CrossEntropyLoss().to(device) # logits and targetoptimizer=optim.Adam(model.parameters(),lr=lr,weight_decay=1e-4)
#scheduler = torch.optim.lr_scheduler.CosineAnnealingLR(optimizer, T_max=num_epoch)accuracy_metric=torchmetrics.Accuracy('multiclass',threshold=0.5,num_classes=10).to(device)
custom_criterion , criterion, optimizer , accracy_metric should be bule like color (which is default to 'variable.) but , In my screen. Only 'optimizer' variable is colored blue. Others (custom_criterion, criterion, accuracy_metric) is colored by yellow though there are NOT method or function.
Extension version: 2025.2.1
VS Code version: Code 1.96.4 (cd4ee3b1c348a13bafd8f9ad8060705f6d4b9cba, 2025-01-16T00:16:19.038Z)
OS version: Linux x64 6.8.0-52-generic
Modes:
I confirmed that criterion and accuracy_metric being yellow is a dupe of #6924. The CrossEntropyLoss and Metric types inherit a __call__ method from Module, so a recent change we made is causing them both to be semantically colored as functions. I'm not sure where Kmeans_Supervised_Contrastive_Loss is defined, but I'm assuming it has the same issue.
Resolving as a dupe. I'm working on a fix for #6924.
Type: Bug
Here is my code. for example,,
custom_criterion , criterion, optimizer , accracy_metric should be bule like color (which is default to 'variable.) but , In my screen. Only 'optimizer' variable is colored blue. Others (custom_criterion, criterion, accuracy_metric) is colored by yellow though there are NOT method or function.
Extension version: 2025.2.1
VS Code version: Code 1.96.4 (cd4ee3b1c348a13bafd8f9ad8060705f6d4b9cba, 2025-01-16T00:16:19.038Z)
OS version: Linux x64 6.8.0-52-generic
Modes:
System Added Logs
System Info
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
webnn: disabled_off
A/B Experiments
The text was updated successfully, but these errors were encountered: