File: pointwise.cpp

package info (click to toggle)
nvidia-cudnn-frontend 1.8.0%2Bds-1
  • links: PTS, VCS
  • area: contrib
  • in suites: forky, sid, trixie
  • size: 4,376 kB
  • sloc: cpp: 58,463; python: 4,138; ansic: 1,407; makefile: 4
file content (1100 lines) | stat: -rw-r--r-- 47,591 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
#include <utility>

#include "pybind11/pybind11.h"
#include "pybind11/cast.h"
#include "pybind11/stl.h"

#include "cudnn_frontend.h"
#include "pygraph.h"

namespace py = pybind11;
using namespace pybind11::literals;

namespace cudnn_frontend::python_bindings {

template <cudnn_frontend::PointwiseMode_t MODE>
std::shared_ptr<cudnn_frontend::graph::Tensor_attributes>
PyGraph::pointwise_ternary(std::shared_ptr<cudnn_frontend::graph::Tensor_attributes>& a,
                           std::shared_ptr<cudnn_frontend::graph::Tensor_attributes>& b,
                           std::shared_ptr<cudnn_frontend::graph::Tensor_attributes>& c,
                           cudnn_frontend::DataType_t const& compute_data_type,
                           std::string const& name) {
    auto attributes = cudnn_frontend::graph::Pointwise_attributes()
                          .set_mode(MODE)
                          .set_compute_data_type(compute_data_type)
                          .set_name(name);
    return graph.pointwise(a, b, c, attributes);
}

template <cudnn_frontend::PointwiseMode_t MODE>
std::shared_ptr<cudnn_frontend::graph::Tensor_attributes>
PyGraph::pointwise_binary(std::shared_ptr<cudnn_frontend::graph::Tensor_attributes>& a,
                          std::shared_ptr<cudnn_frontend::graph::Tensor_attributes>& b,
                          cudnn_frontend::DataType_t const& compute_data_type,
                          std::string const& name) {
    auto attributes = cudnn_frontend::graph::Pointwise_attributes()
                          .set_mode(MODE)
                          .set_compute_data_type(compute_data_type)
                          .set_name(name);
    return graph.pointwise(a, b, attributes);
}

template <cudnn_frontend::PointwiseMode_t MODE>
std::shared_ptr<cudnn_frontend::graph::Tensor_attributes>
PyGraph::pointwise_unary(std::shared_ptr<cudnn_frontend::graph::Tensor_attributes>& a,
                         cudnn_frontend::DataType_t const& compute_data_type,
                         std::string const& name) {
    auto attributes = cudnn_frontend::graph::Pointwise_attributes()
                          .set_mode(MODE)
                          .set_compute_data_type(compute_data_type)
                          .set_name(name);
    return graph.pointwise(a, attributes);
}

std::shared_ptr<cudnn_frontend::graph::Tensor_attributes>
PyGraph::relu(std::shared_ptr<cudnn_frontend::graph::Tensor_attributes>& input,
              std::optional<float> const& negative_slope,
              std::optional<float> const& lower_clip,
              std::optional<float> const& upper_clip,
              cudnn_frontend::DataType_t const& compute_data_type,
              std::string const& name) {
    auto attributes = cudnn_frontend::graph::Pointwise_attributes()
                          .set_compute_data_type(compute_data_type)
                          .set_mode(cudnn_frontend::PointwiseMode_t::RELU_FWD)
                          .set_name(name);

    if (negative_slope.has_value()) {
        attributes.set_relu_lower_clip_slope(negative_slope.value());
    }

    if (lower_clip.has_value()) {
        attributes.set_relu_lower_clip(lower_clip.value());
    }

    if (upper_clip.has_value()) {
        attributes.set_relu_upper_clip(upper_clip.value());
    }

    auto OUT_0 = graph.pointwise(input, attributes);
    return OUT_0;
}

std::shared_ptr<cudnn_frontend::graph::Tensor_attributes>
PyGraph::gen_index(std::shared_ptr<cudnn_frontend::graph::Tensor_attributes>& input,
                   int64_t const axis,
                   cudnn_frontend::DataType_t const& compute_data_type,
                   std::string const& name) {
    auto attributes = cudnn_frontend::graph::Pointwise_attributes()
                          .set_compute_data_type(compute_data_type)
                          .set_mode(cudnn_frontend::PointwiseMode_t::GEN_INDEX)
                          .set_axis(axis)
                          .set_name(name);

    auto OUT_0 = graph.pointwise(input, attributes);
    return OUT_0;
}

std::shared_ptr<cudnn_frontend::graph::Tensor_attributes>
PyGraph::relu_backward(std::shared_ptr<cudnn_frontend::graph::Tensor_attributes>& loss,
                       std::shared_ptr<cudnn_frontend::graph::Tensor_attributes>& input,
                       std::optional<float> const& negative_slope,
                       std::optional<float> const& lower_clip,
                       std::optional<float> const& upper_clip,
                       cudnn_frontend::DataType_t const& compute_data_type,
                       std::string const& name) {
    auto attributes = cudnn_frontend::graph::Pointwise_attributes()
                          .set_compute_data_type(compute_data_type)
                          .set_mode(cudnn_frontend::PointwiseMode_t::RELU_BWD)
                          .set_name(name);

    if (negative_slope.has_value()) {
        attributes.set_relu_lower_clip_slope(negative_slope.value());
    }

    if (lower_clip.has_value()) {
        attributes.set_relu_lower_clip(lower_clip.value());
    }

    if (upper_clip.has_value()) {
        attributes.set_relu_upper_clip(upper_clip.value());
    }

    auto OUT_0 = graph.pointwise(loss, input, attributes);
    return OUT_0;
}

std::shared_ptr<cudnn_frontend::graph::Tensor_attributes>
PyGraph::leaky_relu_backward(std::shared_ptr<cudnn_frontend::graph::Tensor_attributes>& loss,
                             std::shared_ptr<cudnn_frontend::graph::Tensor_attributes>& input,
                             float const negative_slope,
                             cudnn_frontend::DataType_t const& compute_data_type,
                             std::string const& name) {
    return relu_backward(loss, input, negative_slope, std::nullopt, std::nullopt, compute_data_type, name);
}

std::shared_ptr<cudnn_frontend::graph::Tensor_attributes>
PyGraph::leaky_relu(std::shared_ptr<cudnn_frontend::graph::Tensor_attributes>& input,
                    float const negative_slope,
                    cudnn_frontend::DataType_t const& compute_data_type,
                    std::string const& name) {
    return relu(input, negative_slope, std::nullopt, std::nullopt, compute_data_type, name);
}

void
init_pygraph_pointwise_submodule(py::class_<PyGraph>& m) {
    m.def("add",
          &PyGraph::pointwise_binary<cudnn_frontend::PointwiseMode_t::ADD>,
          py::arg("a"),
          py::arg("b"),
          py::arg_v("compute_data_type", cudnn_frontend::DataType_t::NOT_SET),
          py::arg_v("name", ""),
          R"pbdoc(
            Adds two cudnn tensors.

            Args:
                a (cudnn_tensor): The first tensor.
                b (cudnn_tensor): The second tensor.
                compute_data_type (Optional[cudnn.data_type]): The data type for computation. Default is NOT_SET.
                name (Optional[str]): A name for the operation to be performed.

            Returns:
                cudnn_tensor: The result of addition operation.
        )pbdoc");
    m.def("bias",
          &PyGraph::pointwise_binary<cudnn_frontend::PointwiseMode_t::ADD>,
          py::arg("input"),
          py::arg("bias"),
          py::arg_v("compute_data_type", cudnn_frontend::DataType_t::NOT_SET),
          py::arg_v("name", ""),
          R"pbdoc(
            Add bias to the input.

            Args:
                input (cudnn_tensor): The input tensor.
                bias (cudnn_tensor): The bias tensor.
                compute_data_type (Optional[cudnn.data_type]): The data type for computation. Default is NOT_SET.
                name (Optional[str]): A name for the operation to be performed.

            Returns:
                cudnn_tensor: The result of adding bias to the input.
        )pbdoc");
    m.def("mul",
          &PyGraph::pointwise_binary<cudnn_frontend::PointwiseMode_t::MUL>,
          py::arg("a"),
          py::arg("b"),
          py::arg_v("compute_data_type", cudnn_frontend::DataType_t::NOT_SET),
          py::arg_v("name", ""),
          R"pbdoc(
        Computes elementwise multiplication of two cudnn tensors.

        Args:
            a (cudnn_tensor): The first tensor.
            b (cudnn_tensor): The second tensor.
            compute_data_type (Optional[cudnn.data_type]): The data type for computation. Default is NOT_SET.
            name (Optional[str]): A name for the operation to be performed.

        Returns:
            cudnn_tensor: The result of the elementwise multiplication operation.
            )pbdoc");
    m.def("scale",
          &PyGraph::pointwise_binary<cudnn_frontend::PointwiseMode_t::MUL>,
          py::arg("input"),
          py::arg("scale"),
          py::arg_v("compute_data_type", cudnn_frontend::DataType_t::NOT_SET),
          py::arg_v("name", ""),
          R"pbdoc(
            Scale the input.

            Args:
                input (cudnn_tensor): The input tensor.
                scale (cudnn_tensor): The scale tensor.
                compute_data_type (Optional[cudnn.data_type]): The data type for computation. Default is NOT_SET.
                name (Optional[str]): A name for the operation to be performed.

            Returns:
                cudnn_tensor: The result of the scaling operation.
        )pbdoc");

    m.def("sqrt",
          &PyGraph::pointwise_unary<cudnn_frontend::PointwiseMode_t::SQRT>,
          py::arg("input"),
          py::arg_v("compute_data_type", cudnn_frontend::DataType_t::NOT_SET),
          py::arg_v("name", ""),
          R"pbdoc(
        Square root of the input tensor is computed

        Args:
            input (cudnn_tensor): The input tensor.
            compute_data_type (Optional[cudnn.data_type]): The data type for computation. Default is NOT_SET.
            name (Optional[str]): A name for the operation to be performed.

        Returns:
            cudnn_tensor: pointwise square root of the input tensor is computed
        )pbdoc");

    m.def("max",
          &PyGraph::pointwise_binary<cudnn_frontend::PointwiseMode_t::MAX>,
          py::arg("input0"),
          py::arg("input1"),
          py::arg_v("compute_data_type", cudnn_frontend::DataType_t::NOT_SET),
          py::arg_v("name", ""),
          R"pbdoc(
        Max of the input tensors is computed

        Args:
            input (cudnn_tensor): The input tensor 0.
            input (cudnn_tensor): The input tensor 1.
            compute_data_type (Optional[cudnn.data_type]): The data type for computation. Default is NOT_SET.
            name (Optional[str]): A name for the operation to be performed.

        Returns:
            cudnn_tensor: a pointwise maximum is taken between two tensors.
        )pbdoc");
    m.def("min",
          &PyGraph::pointwise_binary<cudnn_frontend::PointwiseMode_t::MIN>,
          py::arg("input0"),
          py::arg("input1"),
          py::arg_v("compute_data_type", cudnn_frontend::DataType_t::NOT_SET),
          py::arg_v("name", ""),
          R"pbdoc(
        Max of the input tensors is computed

        Args:
            input (cudnn_tensor): The input tensor 0.
            input (cudnn_tensor): The input tensor 1.
            compute_data_type (Optional[cudnn.data_type]): The data type for computation. Default is NOT_SET.
            name (Optional[str]): A name for the operation to be performed.

        Returns:
            cudnn_tensor: a pointwise minimum is taken between two tensors.
        )pbdoc");

    m.def("gen_index",
          &PyGraph::gen_index,
          py::arg("input"),
          py::arg("axis"),
          py::arg_v("compute_data_type", cudnn_frontend::DataType_t::NOT_SET),
          py::arg_v("name", ""),
          R"pbdoc(
        Generates pointwise index value of the input tensor is generated along a given axis.

        Args:
            input (cudnn_tensor): The input tensor.
            axis (int): The axis to generate index for.
            compute_data_type (Optional[cudnn.data_type]): The data type for computation. Default is NOT_SET.
            name (Optional[str]): A name for the operation to be performed.

        Returns:
            cudnn_tensor: The result tensor containing the indices
        )pbdoc");

    // forward activations
    m.def("relu",
          &PyGraph::relu,
          py::arg("input"),
          py::arg_v("negative_slope", py::none()),
          py::arg_v("lower_clip", py::none()),
          py::arg_v("upper_clip", py::none()),
          py::arg_v("compute_data_type", cudnn_frontend::DataType_t::NOT_SET),
          py::arg_v("name", ""),
          R"pbdoc(
        Apply the Rectified Linear Unit (ReLU) activation function to the input.

        Args:
            input (cudnn_tensor): The input tensor.
            negative_slope (Optional[float]): Sets the lower clip slope value for ReLU.
            lower_clip (Optional[float]): Sets the lower clip value for ReLU.
            upper_clip (Optional[float]): Sets the upper clip value for ReLU.
            compute_data_type (Optional[cudnn.data_type]): The data type for computation. Default is NOT_SET.
            name (Optional[str]): A name for the operation to be performed.

        Returns:
            cudnn_tensor: The result of the ReLU activation.
        )pbdoc");
    m.def("leaky_relu",
          &PyGraph::leaky_relu,
          py::arg("input"),
          py::arg("negative_slope"),
          py::arg_v("compute_data_type", cudnn_frontend::DataType_t::NOT_SET),
          py::arg_v("name", ""),
          R"pbdoc(
        Apply the Leaky Rectified Linear Unit (Leaky ReLU) activation function to the input.

        Args:
            input (cudnn_tensor): The input tensor.
            negative_slope (float): The slope of the activation for negative inputs.
            compute_data_type (Optional[cudnn.data_type]): The data type for computation. Default is NOT_SET.
            name (Optional[str]): A name for the operation to be performed.

        Returns:
            cudnn_tensor: The result of the Leaky ReLU activation.
        )pbdoc");
    m.def("tanh",
          &PyGraph::pointwise_unary<cudnn_frontend::PointwiseMode_t::TANH_FWD>,
          py::arg("input"),
          py::arg_v("compute_data_type", cudnn_frontend::DataType_t::NOT_SET),
          py::arg_v("name", ""),
          R"pbdoc(
        tanh activation of the input tensors is computed

        Args:
            input (cudnn_tensor): The input tensor.
            compute_data_type (Optional[cudnn.data_type]): The data type for computation. Default is NOT_SET.
            name (Optional[str]): A name for the operation to be performed.

        Returns:
            cudnn_tensor: Result of tanh activation
        )pbdoc");
    m.def("elu",
          &PyGraph::pointwise_unary<cudnn_frontend::PointwiseMode_t::ELU_FWD>,
          py::arg("input"),
          py::arg_v("compute_data_type", cudnn_frontend::DataType_t::NOT_SET),
          py::arg_v("name", ""),
          R"pbdoc(
            Apply the Exponential Linear Unit (ELU) activation function to the input.

            Args:
                input (cudnn_tensor): The input tensor.
                compute_data_type (Optional[cudnn.data_type]): The data type for computation. Default is NOT_SET.
                name (Optional[str]): A name for the operation to be performed.

            Returns:
                cudnn_tensor: The result of the ELU activation.
        )pbdoc");
    m.def("gelu",
          &PyGraph::pointwise_unary<cudnn_frontend::PointwiseMode_t::GELU_FWD>,
          py::arg("input"),
          py::arg_v("compute_data_type", cudnn_frontend::DataType_t::NOT_SET),
          py::arg_v("name", ""),
          R"pbdoc(
            Apply the Gaussian Error Linear Unit (GELU) activation function to the input.

            Args:
                input (cudnn_tensor): The input tensor.
                compute_data_type (Optional[cudnn.data_type]): The data type for computation. Default is NOT_SET.
                name (Optional[str]): A name for the operation to be performed.

            Returns:
                cudnn_tensor: The result of the GELU activation.
        )pbdoc");
    m.def("sigmoid",
          &PyGraph::pointwise_unary<cudnn_frontend::PointwiseMode_t::SIGMOID_FWD>,
          py::arg("input"),
          py::arg_v("compute_data_type", cudnn_frontend::DataType_t::NOT_SET),
          py::arg_v("name", ""),
          R"pbdoc(
            Apply the sigmoid activation function to the input.

            Args:
                input (cudnn_tensor): The input tensor.
                compute_data_type (Optional[cudnn.data_type]): The data type for computation. Default is NOT_SET.
                name (Optional[str]): A name for the operation to be performed.

            Returns:
                cudnn_tensor: The result of the sigmoid activation.
        )pbdoc");
    m.def("swish",
          &PyGraph::pointwise_unary<cudnn_frontend::PointwiseMode_t::SWISH_FWD>,
          py::arg("input"),
          py::arg_v("compute_data_type", cudnn_frontend::DataType_t::NOT_SET),
          py::arg_v("name", ""),
          R"pbdoc(
            Apply the Swish activation function to the input.

            Args:
                input (cudnn_tensor): The input tensor.
                compute_data_type (Optional[cudnn.data_type]): The data type for computation. Default is NOT_SET.
                name (Optional[str]): A name for the operation to be performed.

            Returns:
                cudnn_tensor: The result of the Swish activation.
        )pbdoc");
    m.def("softplus",
          &PyGraph::pointwise_unary<cudnn_frontend::PointwiseMode_t::SOFTPLUS_FWD>,
          py::arg("input"),
          py::arg_v("compute_data_type", cudnn_frontend::DataType_t::NOT_SET),
          py::arg_v("name", ""),
          R"pbdoc(
            Apply the Softplus activation function to the input.

            Args:
                input (cudnn_tensor): The input tensor.
                compute_data_type (Optional[cudnn.data_type]): The data type for computation. Default is NOT_SET.
                name (Optional[str]): A name for the operation to be performed.

            Returns:
                cudnn_tensor: The result of the Softplus activation.
        )pbdoc");
    m.def("gelu_approx_tanh",
          &PyGraph::pointwise_unary<cudnn_frontend::PointwiseMode_t::GELU_APPROX_TANH_FWD>,
          py::arg("input"),
          py::arg_v("compute_data_type", cudnn_frontend::DataType_t::NOT_SET),
          py::arg_v("name", ""),
          R"pbdoc(
            Apply the Approximate GELU activation function to the input.

            Args:
                input (cudnn_tensor): The input tensor.
                compute_data_type (Optional[cudnn.data_type]): The data type for computation. Default is NOT_SET.
                name (Optional[str]): A name for the operation to be performed.

            Returns:
                cudnn_tensor: The result of the Approximate GELU activation.
        )pbdoc");
    // End of forward activations

    // Backward activations
    m.def("relu_backward",
          &PyGraph::relu_backward,
          py::arg("loss"),
          py::arg("input"),
          py::arg_v("negative_slope", py::none()),
          py::arg_v("lower_clip", py::none()),
          py::arg_v("upper_clip", py::none()),
          py::arg_v("compute_data_type", cudnn_frontend::DataType_t::NOT_SET),
          py::arg_v("name", ""),
          R"pbdoc(
            Apply backpropagation on Rectified Linear Unit (ReLU) activation function.

            Args:
                loss (cudnn_tensor): The loss tensor.
                input (cudnn_tensor): The input tensor.
                negative_slope (Optional[float]): Sets the lower clip slope value for ReLU.
                lower_clip (Optional[float]): Sets the lower clip value for ReLU.
                upper_clip (Optional[float]): Sets the upper clip value for ReLU.
                compute_data_type (Optional[cudnn.data_type]): The data type for computation. Default is NOT_SET.
                name (Optional[str]): A name for the operation to be performed.

            Returns:
                cudnn_tensor: The result of backpropagation of ReLU activation.
        )pbdoc");
    m.def("leaky_relu_backward",
          &PyGraph::leaky_relu_backward,
          py::arg("loss"),
          py::arg("input"),
          py::arg("negative_slope"),
          py::arg_v("compute_data_type", cudnn_frontend::DataType_t::NOT_SET),
          py::arg_v("name", ""),
          R"pbdoc(
            Apply backpropagation on Leaky Rectified Linear Unit (Leaky ReLU) activation function.

            Args:
                loss (cudnn_tensor): The loss tensor.
                input (cudnn_tensor): The input tensor.
                negative_slope (float): The slope of the activation for negative inputs.
                compute_data_type (Optional[cudnn.data_type]): The data type for computation. Default is NOT_SET.
                name (Optional[str]): A name for the operation to be performed.

            Returns:
                cudnn_tensor: The result of backpropagation of Leaky ReLU activation.
        )pbdoc");
    m.def("tanh_backward",
          &PyGraph::pointwise_binary<cudnn_frontend::PointwiseMode_t::TANH_BWD>,
          py::arg("loss"),
          py::arg("input"),
          py::arg_v("compute_data_type", cudnn_frontend::DataType_t::NOT_SET),
          py::arg_v("name", ""),
          R"pbdoc(
            Apply backpropagation on tanh activation function.

            Args:
                loss (cudnn_tensor): The loss tensor.
                input (cudnn_tensor): The input tensor.
                compute_data_type (Optional[cudnn.data_type]): The data type for computation. Default is NOT_SET.
                name (Optional[str]): A name for the operation to be performed.

            Returns:
                cudnn_tensor: The result of backpropagation of tanh activation.
        )pbdoc");
    m.def("sigmoid_backward",
          &PyGraph::pointwise_binary<cudnn_frontend::PointwiseMode_t::SIGMOID_BWD>,
          py::arg("loss"),
          py::arg("input"),
          py::arg_v("compute_data_type", cudnn_frontend::DataType_t::NOT_SET),
          py::arg_v("name", ""),
          R"pbdoc(
            Apply backpropagation on sigmoid activation function.

            Args:
                loss (cudnn_tensor): The loss tensor.
                input (cudnn_tensor): The input tensor.
                compute_data_type (Optional[cudnn.data_type]): The data type for computation. Default is NOT_SET.
                name (Optional[str]): A name for the operation to be performed.

            Returns:
                cudnn_tensor: The result of backpropagation of sigmoid activation.
        )pbdoc");
    m.def("elu_backward",
          &PyGraph::pointwise_binary<cudnn_frontend::PointwiseMode_t::ELU_BWD>,
          py::arg("loss"),
          py::arg("input"),
          py::arg_v("compute_data_type", cudnn_frontend::DataType_t::NOT_SET),
          py::arg_v("name", ""),
          R"pbdoc(
            Apply backpropagation on elu activation function.

            Args:
                loss (cudnn_tensor): The loss tensor.
                input (cudnn_tensor): The input tensor.
                compute_data_type (Optional[cudnn.data_type]): The data type for computation. Default is NOT_SET.
                name (Optional[str]): A name for the operation to be performed.

            Returns:
                cudnn_tensor: The result of backpropagation of elu activation.
        )pbdoc");
    m.def("gelu_backward",
          &PyGraph::pointwise_binary<cudnn_frontend::PointwiseMode_t::GELU_BWD>,
          py::arg("loss"),
          py::arg("input"),
          py::arg_v("compute_data_type", cudnn_frontend::DataType_t::NOT_SET),
          py::arg_v("name", ""),
          R"pbdoc(
            Apply backpropagation on gelu activation function.

            Args:
                loss (cudnn_tensor): The loss tensor.
                input (cudnn_tensor): The input tensor.
                compute_data_type (Optional[cudnn.data_type]): The data type for computation. Default is NOT_SET.
                name (Optional[str]): A name for the operation to be performed.

            Returns:
                cudnn_tensor: The result of backpropagation of gelu activation.
        )pbdoc");
    m.def("softplus_backward",
          &PyGraph::pointwise_binary<cudnn_frontend::PointwiseMode_t::SOFTPLUS_BWD>,
          py::arg("loss"),
          py::arg("input"),
          py::arg_v("compute_data_type", cudnn_frontend::DataType_t::NOT_SET),
          py::arg_v("name", ""),
          R"pbdoc(
            Apply backpropagation on softplus activation function.

            Args:
                loss (cudnn_tensor): The loss tensor.
                input (cudnn_tensor): The input tensor.
                compute_data_type (Optional[cudnn.data_type]): The data type for computation. Default is NOT_SET.
                name (Optional[str]): A name for the operation to be performed.

            Returns:
                cudnn_tensor: The result of backpropagation of softplus activation.
        )pbdoc");
    m.def("swish_backward",
          &PyGraph::pointwise_binary<cudnn_frontend::PointwiseMode_t::SWISH_BWD>,
          py::arg("loss"),
          py::arg("input"),
          py::arg_v("compute_data_type", cudnn_frontend::DataType_t::NOT_SET),
          py::arg_v("name", ""),
          R"pbdoc(
            Apply backpropagation on swish activation function.

            Args:
                loss (cudnn_tensor): The loss tensor.
                input (cudnn_tensor): The input tensor.
                compute_data_type (Optional[cudnn.data_type]): The data type for computation. Default is NOT_SET.
                name (Optional[str]): A name for the operation to be performed.

            Returns:
                cudnn_tensor: The result of backpropagation of swish activation.
        )pbdoc");
    m.def("gelu_approx_tanh_backward",
          &PyGraph::pointwise_binary<cudnn_frontend::PointwiseMode_t::GELU_APPROX_TANH_BWD>,
          py::arg("loss"),
          py::arg("input"),
          py::arg_v("compute_data_type", cudnn_frontend::DataType_t::NOT_SET),
          py::arg_v("name", ""),
          R"pbdoc(
            Apply backpropagation on approximate gelu activation function.

            Args:
                loss (cudnn_tensor): The loss tensor.
                input (cudnn_tensor): The input tensor.
                compute_data_type (Optional[cudnn.data_type]): The data type for computation. Default is NOT_SET.
                name (Optional[str]): A name for the operation to be performed.

            Returns:
                cudnn_tensor: The result of backpropagation of approximate gelu activation.
        )pbdoc");
    // End of backward activation functions
    m.def("erf",
          &PyGraph::pointwise_unary<cudnn_frontend::PointwiseMode_t::ERF>,
          py::arg("input"),
          py::arg_v("compute_data_type", cudnn_frontend::DataType_t::NOT_SET),
          py::arg_v("name", ""),
          R"pbdoc(
            Compute erf of input tensor.

            Args:
                input (cudnn_tensor): The input tensor.
                compute_data_type (Optional[cudnn.data_type]): The data type for computation. Default is NOT_SET.
                name (Optional[str]): A name for the operation to be performed.

            Returns:
                cudnn_tensor: The result of erf of input.
        )pbdoc");
    m.def("identity",
          &PyGraph::pointwise_unary<cudnn_frontend::PointwiseMode_t::IDENTITY>,
          py::arg("input"),
          py::arg_v("compute_data_type", cudnn_frontend::DataType_t::NOT_SET),
          py::arg_v("name", ""),
          R"pbdoc(
            Copy input tensor.

            Args:
                input (cudnn_tensor): The input tensor.
                compute_data_type (Optional[cudnn.data_type]): The data type for computation. Default is NOT_SET.
                name (Optional[str]): A name for the operation to be performed.

            Returns:
                cudnn_tensor: The copy of input.
        )pbdoc");

    m.def("exp",
          &PyGraph::pointwise_unary<cudnn_frontend::PointwiseMode_t::EXP>,
          py::arg("input"),
          py::arg_v("compute_data_type", cudnn_frontend::DataType_t::NOT_SET),
          py::arg_v("name", ""),
          R"pbdoc(
            Compute exponential of input tensor.

            Args:
                input (cudnn_tensor): The input tensor.
                compute_data_type (Optional[cudnn.data_type]): The data type for computation. Default is NOT_SET.
                name (Optional[str]): A name for the operation to be performed.

            Returns:
                cudnn_tensor: The result of exponential of input.
        )pbdoc");
    m.def("log",
          &PyGraph::pointwise_unary<cudnn_frontend::PointwiseMode_t::LOG>,
          py::arg("input"),
          py::arg_v("compute_data_type", cudnn_frontend::DataType_t::NOT_SET),
          py::arg_v("name", ""),
          R"pbdoc(
            Compute natural logarithm of input tensor.

            Args:
                input (cudnn_tensor): The input tensor.
                compute_data_type (Optional[cudnn.data_type]): The data type for computation. Default is NOT_SET.
                name (Optional[str]): A name for the operation to be performed.

            Returns:
                cudnn_tensor: The result of natural logarithm of input.
        )pbdoc");
    m.def("neg",
          &PyGraph::pointwise_unary<cudnn_frontend::PointwiseMode_t::NEG>,
          py::arg("input"),
          py::arg_v("compute_data_type", cudnn_frontend::DataType_t::NOT_SET),
          py::arg_v("name", ""),
          R"pbdoc(
            Compute numerical negative of input tensor.

            Args:
                input (cudnn_tensor): The input tensor.
                compute_data_type (Optional[cudnn.data_type]): The data type for computation. Default is NOT_SET.
                name (Optional[str]): A name for the operation to be performed.

            Returns:
                cudnn_tensor: The result of numerical sign negation of input.
        )pbdoc");
    m.def("mod",
          &PyGraph::pointwise_binary<cudnn_frontend::PointwiseMode_t::MOD>,
          py::arg("input0"),
          py::arg("input1"),
          py::arg_v("compute_data_type", cudnn_frontend::DataType_t::NOT_SET),
          py::arg_v("name", ""),
          R"pbdoc(
            In this mode, a pointwise floating-point remainder of the first tensor's division by the second tensor is computed.

            Args:
                input0 (cudnn_tensor): The input tensor.
                input1 (cudnn_tensor): The divisor tensor.
                compute_data_type (Optional[cudnn.data_type]): The data type for computation. Default is NOT_SET.
                name (Optional[str]): A name for the operation to be performed.

            Returns:
                cudnn_tensor: The result of pointwise floating-point remainder of the input0 tensor's division by the input1 tensor
        )pbdoc");
    m.def("pow",
          &PyGraph::pointwise_binary<cudnn_frontend::PointwiseMode_t::POW>,
          py::arg("input0"),
          py::arg("input1"),
          py::arg_v("compute_data_type", cudnn_frontend::DataType_t::NOT_SET),
          py::arg_v("name", ""),
          R"pbdoc(
            In this mode, a pointwise value from the first tensor to the power of the second tensor is computed.

            Args:
                input (cudnn_tensor): The input tensor.
                compute_data_type (Optional[cudnn.data_type]): The data type for computation. Default is NOT_SET.
                name (Optional[str]): A name for the operation to be performed.

            Returns:
                cudnn_tensor: The result of first tensor to the power of the second tensor.
        )pbdoc");
    m.def("abs",
          &PyGraph::pointwise_unary<cudnn_frontend::PointwiseMode_t::ABS>,
          py::arg("input"),
          py::arg_v("compute_data_type", cudnn_frontend::DataType_t::NOT_SET),
          py::arg_v("name", ""),
          R"pbdoc(
            Absolute value of input tensor.

            Args:
                input (cudnn_tensor): The input tensor.
                compute_data_type (Optional[cudnn.data_type]): The data type for computation. Default is NOT_SET.
                name (Optional[str]): A name for the operation to be performed.

            Returns:
                cudnn_tensor: The result of absolute value of input.
        )pbdoc");
    m.def("ceil",
          &PyGraph::pointwise_unary<cudnn_frontend::PointwiseMode_t::CEIL>,
          py::arg("input"),
          py::arg_v("compute_data_type", cudnn_frontend::DataType_t::NOT_SET),
          py::arg_v("name", ""),
          R"pbdoc(
            A pointwise ceiling of the input tensor is computed.

            Args:
                input (cudnn_tensor): The input tensor.
                compute_data_type (Optional[cudnn.data_type]): The data type for computation. Default is NOT_SET.
                name (Optional[str]): A name for the operation to be performed.

            Returns:
                cudnn_tensor: The result of ceil of input.
        )pbdoc");
    m.def("floor",
          &PyGraph::pointwise_unary<cudnn_frontend::PointwiseMode_t::FLOOR>,
          py::arg("input"),
          py::arg_v("compute_data_type", cudnn_frontend::DataType_t::NOT_SET),
          py::arg_v("name", ""),
          R"pbdoc(
            Compute floor of input tensor.

            Args:
                input (cudnn_tensor): The input tensor.
                compute_data_type (Optional[cudnn.data_type]): The data type for computation. Default is NOT_SET.
                name (Optional[str]): A name for the operation to be performed.

            Returns:
                cudnn_tensor: The result of floor of input.
        )pbdoc");
    m.def("rsqrt",
          &PyGraph::pointwise_unary<cudnn_frontend::PointwiseMode_t::RSQRT>,
          py::arg("input"),
          py::arg_v("compute_data_type", cudnn_frontend::DataType_t::NOT_SET),
          py::arg_v("name", ""),
          R"pbdoc(
            Compute reciprocal square root of input tensor.

            Args:
                input (cudnn_tensor): The input tensor.
                compute_data_type (Optional[cudnn.data_type]): The data type for computation. Default is NOT_SET.
                name (Optional[str]): A name for the operation to be performed.

            Returns:
                cudnn_tensor: The result of reciprocal square root of input.
        )pbdoc");
    m.def("reciprocal",
          &PyGraph::pointwise_unary<cudnn_frontend::PointwiseMode_t::RECIPROCAL>,
          py::arg("input"),
          py::arg_v("compute_data_type", cudnn_frontend::DataType_t::NOT_SET),
          py::arg_v("name", ""),
          R"pbdoc(
            Compute reciprocal input tensor.

            Args:
                input (cudnn_tensor): The input tensor.
                compute_data_type (Optional[cudnn.data_type]): The data type for computation. Default is NOT_SET.
                name (Optional[str]): A name for the operation to be performed.

            Returns:
                cudnn_tensor: The result of reciprocal of input.
        )pbdoc");
    m.def("sin",
          &PyGraph::pointwise_unary<cudnn_frontend::PointwiseMode_t::SIN>,
          py::arg("input"),
          py::arg_v("compute_data_type", cudnn_frontend::DataType_t::NOT_SET),
          py::arg_v("name", ""),
          R"pbdoc(
            Compute Sine of input tensor.

            Args:
                input (cudnn_tensor): The input tensor.
                compute_data_type (Optional[cudnn.data_type]): The data type for computation. Default is NOT_SET.
                name (Optional[str]): A name for the operation to be performed.

            Returns:
                cudnn_tensor: The result of sine of input.
        )pbdoc");
    m.def("cos",
          &PyGraph::pointwise_unary<cudnn_frontend::PointwiseMode_t::COS>,
          py::arg("input"),
          py::arg_v("compute_data_type", cudnn_frontend::DataType_t::NOT_SET),
          py::arg_v("name", ""),
          R"pbdoc(
            Compute Cosine of input tensor.

            Args:
                input (cudnn_tensor): The input tensor.
                compute_data_type (Optional[cudnn.data_type]): The data type for computation. Default is NOT_SET.
                name (Optional[str]): A name for the operation to be performed.

            Returns:
                cudnn_tensor: The result of cosine of input.
        )pbdoc");
    m.def("tan",
          &PyGraph::pointwise_unary<cudnn_frontend::PointwiseMode_t::TAN>,
          py::arg("input"),
          py::arg_v("compute_data_type", cudnn_frontend::DataType_t::NOT_SET),
          py::arg_v("name", ""),
          R"pbdoc(
            Compute Tangent of input tensor.

            Args:
                input (cudnn_tensor): The input tensor.
                compute_data_type (Optional[cudnn.data_type]): The data type for computation. Default is NOT_SET.
                name (Optional[str]): A name for the operation to be performed.

            Returns:
                cudnn_tensor: The result of tangent of input.
        )pbdoc");
    m.def("logical_not",
          &PyGraph::pointwise_unary<cudnn_frontend::PointwiseMode_t::LOGICAL_NOT>,
          py::arg("input"),
          py::arg_v("compute_data_type", cudnn_frontend::DataType_t::NOT_SET),
          py::arg_v("name", ""),
          R"pbdoc(
        Compute logical_not of input tensor.

        Args:
            input (cudnn_tensor): The input tensor.
            compute_data_type (Optional[cudnn.data_type]): The data type for computation. Default is NOT_SET.
            name (Optional[str]): A name for the operation to be performed.

        Returns:
            cudnn_tensor: The result of logical_not of input.
    )pbdoc");
    m.def("logical_and",
          &PyGraph::pointwise_binary<cudnn_frontend::PointwiseMode_t::LOGICAL_AND>,
          py::arg("a"),
          py::arg("b"),
          py::arg_v("compute_data_type", cudnn_frontend::DataType_t::NOT_SET),
          py::arg_v("name", ""),
          R"pbdoc(
        Computes logical and of two tensors.

        Args:
            a (cudnn_tensor): The tensor to subtract from.
            b (cudnn_tensor): The tensor to subtract with.
            compute_data_type (Optional[cudnn.data_type]): The data type for computation. Default is NOT_SET.
            name (Optional[str]): A name for the operation to be performed.

        Returns:
            cudnn_tensor: The result of logical and between two tensors.
    )pbdoc");
    m.def("logical_or",
          &PyGraph::pointwise_binary<cudnn_frontend::PointwiseMode_t::LOGICAL_OR>,
          py::arg("a"),
          py::arg("b"),
          py::arg_v("compute_data_type", cudnn_frontend::DataType_t::NOT_SET),
          py::arg_v("name", ""),
          R"pbdoc(
        Computes logical or of two tensors.

        Args:
            a (cudnn_tensor): The tensor to subtract from.
            b (cudnn_tensor): The tensor to subtract with.
            compute_data_type (Optional[cudnn.data_type]): The data type for computation. Default is NOT_SET.
            name (Optional[str]): A name for the operation to be performed.

        Returns:
            cudnn_tensor: The result of logical or between two tensors.
    )pbdoc");

    m.def("sub",
          &PyGraph::pointwise_binary<cudnn_frontend::PointwiseMode_t::SUB>,
          py::arg("a"),
          py::arg("b"),
          py::arg_v("compute_data_type", cudnn_frontend::DataType_t::NOT_SET),
          py::arg_v("name", ""),
          R"pbdoc(
        Computes subtraction of two tensors.

        Args:
            a (cudnn_tensor): The tensor to subtract from.
            b (cudnn_tensor): The tensor to subtract with.
            compute_data_type (Optional[cudnn.data_type]): The data type for computation. Default is NOT_SET.
            name (Optional[str]): A name for the operation to be performed.

        Returns:
            cudnn_tensor: The result of subtration.
    )pbdoc");
    m.def("div",
          &PyGraph::pointwise_binary<cudnn_frontend::PointwiseMode_t::DIV>,
          py::arg("a"),
          py::arg("b"),
          py::arg_v("compute_data_type", cudnn_frontend::DataType_t::NOT_SET),
          py::arg_v("name", ""),
          R"pbdoc(
            Computes Division of two tensors.

            Args:
                a (cudnn_tensor): The tensor to subtract from.
                b (cudnn_tensor): The tensor to subtract with.
                compute_data_type (Optional[cudnn.data_type]): The data type for computation. Default is NOT_SET.
                name (Optional[str]): A name for the operation to be performed.

            Returns:
                cudnn_tensor: The result of Division.
        )pbdoc");
    m.def("add_square",
          &PyGraph::pointwise_binary<cudnn_frontend::PointwiseMode_t::ADD_SQUARE>,
          py::arg("a"),
          py::arg("b"),
          py::arg_v("compute_data_type", cudnn_frontend::DataType_t::NOT_SET),
          py::arg_v("name", ""),
          R"pbdoc(
            a pointwise addition between the first tensor and the square of the second tensor is computed.

            Args:
                a (cudnn_tensor): The tensor to subtract from.
                b (cudnn_tensor): The tensor to subtract with.
                compute_data_type (Optional[cudnn.data_type]): The data type for computation. Default is NOT_SET.
                name (Optional[str]): A name for the operation to be performed.

            Returns:
                cudnn_tensor: The result of a pointwise addition between the first tensor and the square of the second tensor is computed.
        )pbdoc");

    m.def("cmp_eq",
          &PyGraph::pointwise_binary<cudnn_frontend::PointwiseMode_t::CMP_EQ>,
          py::arg("input"),
          py::arg("comparison"),
          py::arg_v("compute_data_type", cudnn_frontend::DataType_t::NOT_SET),
          py::arg_v("name", ""),
          R"pbdoc(
            Apply the Compare Equal to Comparison to the input.

            Args:
                input (cudnn_tensor): The input tensor.
                comparison (cudnn_tensor): The comparison tensor.
                compute_data_type (Optional[cudnn.data_type]): The data type for computation. Default is NOT_SET.
                name (Optional[str]): A name for the operation to be performed.

            Returns:
                cudnn_tensor: The result of the comparison.
        )pbdoc");
    m.def("cmp_neq",
          &PyGraph::pointwise_binary<cudnn_frontend::PointwiseMode_t::CMP_NEQ>,
          py::arg("input"),
          py::arg("comparison"),
          py::arg_v("compute_data_type", cudnn_frontend::DataType_t::NOT_SET),
          py::arg_v("name", ""),
          R"pbdoc(
            Apply the Compare Not equal to Comparison to the input.

            Args:
                input (cudnn_tensor): The input tensor.
                comparison (cudnn_tensor): The comparison tensor.
                compute_data_type (Optional[cudnn.data_type]): The data type for computation. Default is NOT_SET.
                name (Optional[str]): A name for the operation to be performed.

            Returns:
                cudnn_tensor: The result of the comparison.
        )pbdoc");
    m.def("cmp_gt",
          &PyGraph::pointwise_binary<cudnn_frontend::PointwiseMode_t::CMP_GT>,
          py::arg("input"),
          py::arg("comparison"),
          py::arg_v("compute_data_type", cudnn_frontend::DataType_t::NOT_SET),
          py::arg_v("name", ""),
          R"pbdoc(
            Apply the Compare Greater Than Comparison to the input.

            Args:
                input (cudnn_tensor): The input tensor.
                comparison (cudnn_tensor): The comparison tensor.
                compute_data_type (Optional[cudnn.data_type]): The data type for computation. Default is NOT_SET.
                name (Optional[str]): A name for the operation to be performed.

            Returns:
                cudnn_tensor: The result of the comparison.
        )pbdoc");
    m.def("cmp_ge",
          &PyGraph::pointwise_binary<cudnn_frontend::PointwiseMode_t::CMP_GE>,
          py::arg("input"),
          py::arg("comparison"),
          py::arg_v("compute_data_type", cudnn_frontend::DataType_t::NOT_SET),
          py::arg_v("name", ""),
          R"pbdoc(
            Apply the Compare Greater Than or Equal Comparison to the input.

            Args:
                input (cudnn_tensor): The input tensor.
                comparison (cudnn_tensor): The comparison tensor.
                compute_data_type (Optional[cudnn.data_type]): The data type for computation. Default is NOT_SET.
                name (Optional[str]): A name for the operation to be performed.

            Returns:
                cudnn_tensor: The result of the comparison.
        )pbdoc");
    m.def("cmp_lt",
          &PyGraph::pointwise_binary<cudnn_frontend::PointwiseMode_t::CMP_LT>,
          py::arg("input"),
          py::arg("comparison"),
          py::arg_v("compute_data_type", cudnn_frontend::DataType_t::NOT_SET),
          py::arg_v("name", ""),
          R"pbdoc(
            Apply the Compare Lesser Than Comparison to the input.

            Args:
                input (cudnn_tensor): The input tensor.
                comparison (cudnn_tensor): The comparison tensor.
                compute_data_type (Optional[cudnn.data_type]): The data type for computation. Default is NOT_SET.
                name (Optional[str]): A name for the operation to be performed.

            Returns:
                cudnn_tensor: The result of the comparison.
        )pbdoc");
    m.def("cmp_le",
          &PyGraph::pointwise_binary<cudnn_frontend::PointwiseMode_t::CMP_LE>,
          py::arg("input"),
          py::arg("comparison"),
          py::arg_v("compute_data_type", cudnn_frontend::DataType_t::NOT_SET),
          py::arg_v("name", ""),
          R"pbdoc(
            Apply the Compare Lesser Than or Equal Comparison to the input.

            Args:
                input (cudnn_tensor): The input tensor.
                comparison (cudnn_tensor): The comparison tensor.
                compute_data_type (Optional[cudnn.data_type]): The data type for computation. Default is NOT_SET.
                name (Optional[str]): A name for the operation to be performed.

            Returns:
                cudnn_tensor: The result of the comparison.
        )pbdoc");
    m.def("binary_select",
          &PyGraph::pointwise_ternary<cudnn_frontend::PointwiseMode_t::BINARY_SELECT>,
          py::arg("input0"),
          py::arg("input1"),
          py::arg("mask"),
          py::arg_v("compute_data_type", cudnn_frontend::DataType_t::NOT_SET),
          py::arg_v("name", ""),
          R"pbdoc(
            Selects between input0 or input1 based on the mask

            Args:
                input0 (cudnn_tensor): The input tensor0.
                input1 (cudnn_tensor): The input tensor1.
                mask (cudnn_tensor): The mask tensor.
                compute_data_type (Optional[cudnn.data_type]): The data type for computation. Default is NOT_SET.
                name (Optional[str]): A name for the operation to be performed.

            Returns:
                cudnn_tensor: The result of the comparison.
        )pbdoc");
}

}  // namespace cudnn_frontend::python_bindings