Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
Update operator.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jermainewang committed Sep 19, 2015
1 parent 2657094 commit 8d40480
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions doc/developer-guide/operator.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ It is possible that one convolution has several implementations and users want t
}
```
* **Inplace Option:** To further save memory allocation cost, the operator could specify it could support inplace operation. This usually happens for element-wise operations when input tensor and output tensor are of the same shape. This could be specified by the following interface:
* **Inplace Option:** To further save memory allocation cost, inplace update are welcomed. This usually happens for element-wise operations when input tensor and output tensor are of the same shape. This could be specified by the following interface:
```c++
virtual std::vector<std::pair<int, void*>> ElewiseOpProperty::ForwardInplaceOption(
const std::vector<int> &in_data,
Expand All @@ -140,7 +140,7 @@ It is possible that one convolution has several implementations and users want t
```
The above tells the system the `in_data[0]` and `out_data[0]` tensors could share the same memory spaces during `Forward`, and so do `out_grad[0]` and `in_grad[0]` during `Backward`.

**ATTENTION:** Even with the above specification, it is *not* guaranteed that input and output tensors will share the same space. In fact, this is only a hint for the system for the final decision. However, in either case, such decision is completely transparent to user, so the actual `Forward` and `Backward` implementation does not need to consider that.
>**ATTENTION:** Even with the above specification, it is *not* guaranteed that input and output tensors will share the same space. In fact, this is only a hint for the system for the final decision. However, in either case, such decision is completely transparent to user, so the actual `Forward` and `Backward` implementation does not need to consider that.
* **Expose Operator to Python:** Due to the restriction of c++ language, we need user to implement following interfaces:
```c++
Expand Down

0 comments on commit 8d40480

Please sign in to comment.