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
z=[0.1]
im2 = torch.tensor(z, dtype=torch.float32)
print(im2)
now,output im2=》0.1, and im2 device is cpu,
print(im2>0.25)=》False(this output is correct)
Here,we put im2 to opencl device
im2=im2.to(device)
and, we print im2>0.25:
print(im2>0.25)
this output is True,and the output is uncorrrect.
It should to output False
I check the compare kernel and print scale in kernel, w(scale) is 0 of above example
I meet a stranger problem:tensor comparison work error at some test data, other test data is correct, is strange problem
this my code:
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
device="ocl:0"
if device.find('ocl')==0:
torch.ops.load_library("../libpt_ocl.so")
device = device.replace('ocl','privateuseone')
y=[5.7657e-05, 11.25,2.2863e-05, 1.5291e-05, 9.2284e-06, 1.2024e-05, 1.1976e-05,1.4908e-05, 1.6296e-05, 1.3599e-05, 1.7960e-05]
im = torch.tensor(y, dtype=torch.float32)
im=im.to(device)
print(im>0.25)
z=[0.1]
im2 = torch.tensor(z, dtype=torch.float32)
print(im2)
print(im2>0.25)
im2=im2.to(device)
print(im2)
print(im2>0.25)
The text was updated successfully, but these errors were encountered: