This commit is contained in:
George Hotz
2022-08-30 19:52:21 -07:00
parent 3af650b028
commit e194ae0c1d
4 changed files with 4 additions and 4 deletions

View File

@@ -8,7 +8,7 @@ def preprocessing_op(x,w,C):
#print(x.shape, w.shape)
if C.bs > 1 and C.py > 0:
# explictly add y-padding for batched inputs
# explicitly add y-padding for batched inputs
# N C H W
xs = [(0, 0) for _ in x.shape]
xs[2] = (C.py, C.py)

View File

@@ -18,7 +18,7 @@ def get_conv_args(x_shape, w_shape, stride=1, groups=1, padding=0, dilation=1, o
bs,cin_,iy,ix = x_shape
# this can change px_ and py_ to make the out_shape right
# TOOD: copy padding names from http://nvdla.org/hw/v1/ias/unit_description.html
# TODO: copy padding names from http://nvdla.org/hw/v1/ias/unit_description.html
if out_shape is not None:
py_ = (out_shape[2] - 1) * sy + 1 + dy * (H-1) - iy - py
px_ = (out_shape[3] - 1) * sx + 1 + dx * (W-1) - ix - px

View File

@@ -141,7 +141,7 @@ def _realize_binaryops(self:LazyBuffer) -> Tuple[DeviceBuffer, List[DeviceBuffer
earlycode = "acc"
conv_args : Optional[ConvArgs] = None
# if there's *one* processing or reduce op in here, we can corealize it. we can corealize binary op sibilings as well
# if there's *one* processing or reduce op in here, we can corealize it. we can corealize binary op siblings as well
# NOTE: if it references the same conv multiple times, they should already be merged by the dictionary
psrcs : List[Tuple[LazyBuffer, LazyBuffer]] = [(k,x) for k,x in zip(real_srcs.keys(), map(get_movementroot_contiguous, real_srcs.keys())) if x.optype in [ProcessingOps,ReduceOps] and x.realized is None and len(x.children) <= 1 and len(k.children) <= 1]
if len(psrcs) == 1 and MERGE_ONE_REDUCE_INTO_ELEMENTWISE:

View File

@@ -61,7 +61,7 @@ class Tensor:
def detach(self): return Tensor(self.lazydata, device=self.device, requires_grad=False)
def numpy(self): return np.array(self.lazydata.toCPU())
# TOOD: this keeps the legacy behavior working, remove it after refactor
# TODO: this keeps the legacy behavior working, remove it after refactor
@property
def data(self): return self.numpy()