Skip to content

Instantly share code, notes, and snippets.

View HSILA's full-sized avatar

HSILA HSILA

  • McMaster University
  • Ontario, Canada
  • 11:38 (UTC -04:00)
  • LinkedIn in/ali-shiraee
View GitHub Profile
@HSILA
HSILA / onnx_cumsum.py
Last active July 2, 2022 06:15
ONNX CumSum operator shouldn't get boolean but model checker won't check it
import torch
from torch import nn
import onnx
import onnxruntime
a = torch.tensor([12, 0, 5, 154], dtype=torch.float32)
# a.to(torch.bool) = tensor([True, False, True, True])
# ~a.to(torch.bool) = tensor([False, True, False, False])