Skip to content

Commit

Permalink
#9874: Update files
Browse files Browse the repository at this point in the history
  • Loading branch information
VirdhatchaniKN committed Jul 9, 2024
1 parent 134bc89 commit c025307
Show file tree
Hide file tree
Showing 17 changed files with 13 additions and 33 deletions.
6 changes: 0 additions & 6 deletions docs/source/ttnn/ttnn/ttnn/binary_eq_bw.rst

This file was deleted.

6 changes: 6 additions & 0 deletions docs/source/ttnn/ttnn/ttnn/eq_bw.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.. _ttnn.eq_bw:

ttnn.eq_bw
#################

.. autofunction:: ttnn.eq_bw
6 changes: 0 additions & 6 deletions docs/source/ttnn/ttnn/ttnn/unary_eq_bw.rst

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import torch
import pytest
import tt_lib
import ttnn
from tests.tt_eager.python_api_testing.unit_testing.backward_ops.utility_funcs import data_gen_with_range, compare_pcc

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import torch
import pytest
import tt_lib
import ttnn
from tests.tt_eager.python_api_testing.unit_testing.backward_ops.utility_funcs import data_gen_with_range, compare_pcc

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import torch
import pytest
import tt_lib
import ttnn
from tests.tt_eager.python_api_testing.unit_testing.backward_ops.utility_funcs import data_gen_with_range, compare_pcc

Expand Down Expand Up @@ -50,9 +49,7 @@ def test_bw_binary_assign(input_shapes, device):
grad_data, grad_tensor = data_gen_with_range(input_shapes, -100, 100, device)

tt_output_tensor_on_device = ttnn.assign_bw(grad_tensor, input_tensor, other_tensor)
print(tt_output_tensor_on_device)
print(grad_tensor)
print(input_tensor, other_tensor)

in_data.retain_grad()

pyt_y = torch.clone(in_data)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import torch
import pytest
import tt_lib
import ttnn
from tests.tt_eager.python_api_testing.unit_testing.backward_ops.utility_funcs import (
data_gen_with_range,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import torch
import pytest
import tt_lib
import ttnn
from tests.tt_eager.python_api_testing.unit_testing.backward_ops.utility_funcs import compare_pcc, data_gen_with_range

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import torch
import pytest
import tt_lib
import ttnn
from tests.tt_eager.python_api_testing.unit_testing.backward_ops.utility_funcs import data_gen_with_range, compare_pcc

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import torch
import pytest
import tt_lib
import ttnn
from tests.tt_eager.python_api_testing.unit_testing.backward_ops.utility_funcs import data_gen_with_range, compare_pcc

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import torch
import pytest
import tt_lib
import ttnn
from tests.tt_eager.python_api_testing.unit_testing.backward_ops.utility_funcs import data_gen_with_range, compare_pcc

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import torch
import pytest
import tt_lib
import ttnn
from tests.tt_eager.python_api_testing.unit_testing.backward_ops.utility_funcs import data_gen_with_range, compare_pcc

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import torch
import pytest
import tt_lib
import ttnn
from tests.tt_eager.python_api_testing.unit_testing.backward_ops.utility_funcs import data_gen_with_range, compare_pcc

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import torch
import pytest
import tt_lib
import ttnn
from tests.tt_eager.python_api_testing.unit_testing.backward_ops.utility_funcs import data_gen_with_range, compare_pcc

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import torch
import pytest
import tt_lib
import ttnn
from tests.tt_eager.python_api_testing.unit_testing.backward_ops.utility_funcs import data_gen_with_range, compare_pcc

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ std::vector<Tensor> _add_bw(
return grad_tensor;
}

std::vector<Tensor> _unary_comp_bw(const Tensor& grad, const Tensor& input, float other, const MemoryConfig& output_mem_config) {
std::vector<Tensor> _unary_comp_bw(const Tensor& grad, const MemoryConfig& output_mem_config) {
std::vector<Tensor> grad_tensor;
Tensor zero_grad = tt::tt_metal::zeros_like(grad, output_mem_config);
grad_tensor.emplace_back(zero_grad);
Expand All @@ -90,7 +90,7 @@ std::vector<Tensor> _unary_comp_bw(const Tensor& grad, const Tensor& input, floa

std::vector<Tensor> _eq_bw(
const Tensor& grad, const Tensor& input, float other, const MemoryConfig& output_mem_config) {
return _unary_comp_bw(grad, input, other, output_mem_config);
return _unary_comp_bw(grad, output_mem_config);
}

std::function<std::vector<ttnn::Tensor>(const Tensor&, const Tensor&, const MemoryConfig&)> get_function_type1(UnaryBackwardOpType OpType){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ void py_module(py::module& module) {
detail::bind_unary_backward(
module,
ttnn::mul_bw,
R"doc(Performs backward operations for multiply on :attr:`input_tensor`, :attr:`alpha` with given :attr:`grad_tensor`.)doc");
R"doc(Performs backward operations for multiply on :attr:`input_tensor`, :attr:`alpha` or attr:`input_tensor_a`, attr:`input_tensor_b` with given :attr:`grad_tensor`.)doc");

detail::bind_unary_backward(
module,
Expand All @@ -175,7 +175,7 @@ void py_module(py::module& module) {
detail::bind_unary_backward(
module,
ttnn::assign_bw,
R"doc(Performs backward operations for assign on :attr:`input_tensor` with given :attr:`grad_tensor`.)doc");
R"doc(Performs backward operations for assign on :attr:`input_tensor` or attr:`input_tensor_a`, attr:`input_tensor_b` with given :attr:`grad_tensor`.)doc");

detail::bind_unary_backward(
module,
Expand All @@ -187,12 +187,12 @@ void py_module(py::module& module) {
detail::bind_unary_backward(
module,
ttnn::add_bw,
R"doc(Performs backward operations for addition on :attr:`input_tensor`, :attr:`alpha` with given :attr:`grad_tensor`.)doc");
R"doc(Performs backward operations for addition on :attr:`input_tensor`, :attr:`alpha` or attr:`input_tensor_a`, attr:`input_tensor_b` with given :attr:`grad_tensor`.)doc");

detail::bind_unary_backward(
module,
ttnn::eq_bw,
R"doc(Performs backward operations for equal to comparison on :attr:`input_tensor`, :attr:`alpha` or attr:`input_tensor_b` with given :attr:`grad_tensor`.
R"doc(Performs backward operations for equal to comparison on :attr:`input_tensor`, :attr:`alpha` or attr:`input_tensor_a`, attr:`input_tensor_b` with given :attr:`grad_tensor`.
Returns an tensor of zeros like input tensors.)doc");

}
Expand Down

0 comments on commit c025307

Please sign in to comment.