in test_foreach.py pacth KINETO_LOG_LEVEL to silence profiler log (#126048)

as per title, `patch.dict` the env var in favor of cleaner logs.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/126048
Approved by: https://github.com/janeyx99
This commit is contained in:
Masaki Kozuki 2024-05-13 15:31:56 +00:00 committed by PyTorch MergeBot
parent 7899034282
commit 96bdb7a0fb

View file

@ -1,6 +1,7 @@
# Owner(s): ["module: mta"]
import itertools
import os
import random
import re
import unittest
@ -132,6 +133,7 @@ def get_transform_func(num_tensors, dtype, device, is_fastpath):
# note(crcrpar): `zero_size` is `False` unless (dtype, device) == (torch.float32, "cuda")
# as the pair would go through `multi_tensor_apply_kernel` if inputs are not zero size.
@unittest.mock.patch.dict(os.environ, {"KINETO_LOG_LEVEL": "5"})
class TestForeach(TestCase):
@property
def is_cuda(self):