mirror of https://github.com/commaai/tinygrad.git
CastLike works with one type hack
This commit is contained in:
parent
1ffe8d68d5
commit
082134952b
|
@ -151,3 +151,8 @@ def Tile(input, repeats):
|
|||
|
||||
def Range(start, limit, delta): return Tensor.arange(safe_numpy(limit)[0], safe_numpy(start)[0], safe_numpy(delta)[0])
|
||||
def Where(condition, X, Y): return condition*X + (1-condition)*Y
|
||||
|
||||
# NOTE: since we only have one type, this is valid!
|
||||
def CastLike(input, target_type):
|
||||
assert isinstance(target_type, Tensor), "can only CastLike Tensor"
|
||||
return input
|
||||
|
|
Loading…
Reference in New Issue