tensorflow :: ops :: ResourceScatterNdSub
#include <state_ops.h>
Variable의 개별 값 또는 슬라이스에 희소 빼기를 적용합니다.
요약
ref
는 순위가 P
Tensor
이고 indices
는 순위가 Q
Tensor
입니다.
indices
는 ref
인덱스를 포함하는 정수 텐서 여야합니다. 모양은 [d_0, ..., d_{Q-2}, K]
여야합니다 [d_0, ..., d_{Q-2}, K]
여기서 0 < K <= P
indices
의 가장 안쪽 차원 (길이 K
)은 ref
의 K
번째 차원을 따라 요소 ( K = P
) 또는 슬라이스 ( K < P
경우)에 대한 인덱스에 해당합니다.
updates
는 Q-1+PK
등급의 Tensor
입니다.
[d_0, ..., d_{Q-2}, ref.shape[K], ..., ref.shape[P-1]]
예를 들어, 8 개의 요소가있는 랭크 1 텐서에서 4 개의 흩어진 요소를 빼고 싶다고 가정 해 보겠습니다. Python에서 빼기는 다음과 같습니다.
ref = tf.Variable([1, 2, 3, 4, 5, 6, 7, 8], use_resource=True) indices = tf.constant([[4], [3], [1], [7]]) updates = tf.constant([9, 10, 11, 12]) sub = tf.scatter_nd_sub(ref, indices, updates) with tf.Session() as sess: print sess.run(sub)
ref에 대한 결과 업데이트는 다음과 같습니다.
[1, -9, 3, -6, -4, 6, 7, -4]
슬라이스를 업데이트하는 방법에 대한 자세한 내용은 tf.scatter_nd
를 참조하세요.
인수 :
- 범위 : 범위 개체
- ref : 리소스 핸들. VarHandleOp에서 가져온 것이어야합니다.
- 인덱스 : Tensor . 다음 유형 중 하나 여야합니다. int32, int64 ref에 대한 인덱스의 텐서.
- 업데이트 : Tensor . ref와 동일한 유형이어야합니다. ref에 더할 값의 텐서.
선택적 속성 ( Attrs
참조) :
- use_locking : 선택적 bool입니다. 기본값은 True입니다. True이면 할당이 잠금으로 보호됩니다. 그렇지 않으면 동작이 정의되지 않지만 경합이 적을 수 있습니다.
보고:
- 생성 된
Operation
생성자와 소멸자 | |
---|---|
ResourceScatterNdSub (const :: tensorflow::Scope & scope, :: tensorflow::Input ref, :: tensorflow::Input indices, :: tensorflow::Input updates) | |
ResourceScatterNdSub (const :: tensorflow::Scope & scope, :: tensorflow::Input ref, :: tensorflow::Input indices, :: tensorflow::Input updates, const ResourceScatterNdSub::Attrs & attrs) |
공용 속성 | |
---|---|
operation |
공공 기능 | |
---|---|
operator::tensorflow::Operation () const |
공개 정적 함수 | |
---|---|
UseLocking (bool x) |
구조체 | |
---|---|
tensorflow :: ops :: ResourceScatterNdSub :: Attrs | ResourceScatterNdSub에 대한 선택적 속성 설정자. |
공용 속성
조작
Operation operation
공공 기능
ResourceScatterNdSub
ResourceScatterNdSub( const ::tensorflow::Scope & scope, ::tensorflow::Input ref, ::tensorflow::Input indices, ::tensorflow::Input updates )
ResourceScatterNdSub
ResourceScatterNdSub( const ::tensorflow::Scope & scope, ::tensorflow::Input ref, ::tensorflow::Input indices, ::tensorflow::Input updates, const ResourceScatterNdSub::Attrs & attrs )
operator :: tensorflow :: Operation
operator::tensorflow::Operation() const
공개 정적 함수
사용 잠금
Attrs UseLocking( bool x )