utils.h 262 Bytes
Newer Older
rusty1s's avatar
rusty1s committed
1
2
#pragma once

rusty1s's avatar
rusty1s committed
3
#include <torch/extension.h>
rusty1s's avatar
rusty1s committed
4

rusty1s's avatar
rusty1s committed
5
6
#define CHECK_CPU(x) AT_ASSERTM(x.device().is_cpu(), #x " must be CPU tensor")
#define CHECK_INPUT(x) AT_ASSERTM(x, "Input mismatch")
rusty1s's avatar
rusty1s committed
7
#define CHECK_CONTIGUOUS(x) AT_ASSERTM(x.is_contiguous(), #x " must be contiguous")