mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-04-29 03:00:14 -04:00
clean up nan handling in transcendental (#7332)
* clean up nan handling in transcendental * skip remu crash
This commit is contained in:
@@ -1,11 +1,10 @@
|
||||
import time, math, unittest
|
||||
import time, math, unittest, functools
|
||||
import numpy as np
|
||||
from typing import List, Callable
|
||||
import torch
|
||||
from tinygrad.helpers import getenv, IMAGE, DEBUG, CI, Context
|
||||
from tinygrad.helpers import getenv, IMAGE, DEBUG, CI, Context, TRANSCENDENTAL
|
||||
from tinygrad import Tensor, Device, dtypes
|
||||
from tinygrad.tensor import _to_np_dtype
|
||||
import functools
|
||||
|
||||
if CI:
|
||||
import warnings
|
||||
@@ -605,6 +604,7 @@ class TestOps(unittest.TestCase):
|
||||
def test_abs_exact(self):
|
||||
helper_test_op(None, torch.abs, Tensor.abs, vals=[[-1.,0,1]])
|
||||
|
||||
@unittest.skipIf(TRANSCENDENTAL and Device.DEFAULT=="AMD", "TODO: remu crashes")
|
||||
def test_log(self):
|
||||
helper_test_op([(45,65)], torch.log, Tensor.log)
|
||||
helper_test_op(None, torch.log, Tensor.log, vals=[[math.inf, -math.inf, math.nan]])
|
||||
@@ -614,6 +614,7 @@ class TestOps(unittest.TestCase):
|
||||
helper_test_op(None, torch.log2, Tensor.log2, vals=[[math.inf, -math.inf, math.nan]])
|
||||
helper_test_op([()], torch.log2, Tensor.log2)
|
||||
|
||||
@unittest.skipIf(TRANSCENDENTAL and Device.DEFAULT=="AMD", "TODO: remu crashes")
|
||||
def test_exp(self):
|
||||
helper_test_op([(45,65)], torch.exp, Tensor.exp)
|
||||
helper_test_op(None, torch.exp, Tensor.exp, vals=[[math.inf, -math.inf, math.nan]])
|
||||
|
||||
Reference in New Issue
Block a user