File size: 488 Bytes
19faf57
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
"""Minimal stub for tensorflow to allow static imports in tests and linters.

This does not implement real TensorFlow functionality.

"""
from typing import Any

class Tensor:
    def __init__(self, data: Any):
        self.data = data

def constant(value: Any):
    return Tensor(value)

def device(name: str):
    class _ctx:
        def __enter__(self):
            return None
        def __exit__(self, exc_type, exc, tb):
            return False
    return _ctx()