Skip to content

Commit bda559c

Browse files
committed
Fix typos for efforts with adding torch.nn functions.
1 parent 02610ff commit bda559c

4 files changed

Lines changed: 10 additions & 207 deletions

File tree

bridge/lib/Bridge.chpl

Lines changed: 0 additions & 193 deletions
This file was deleted.

bridge/lib/bridge.cpp

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,7 @@ extern "C" bridge_tensor_t softplus(
685685
.beta(beta)
686686
.threshold(threshold));
687687

688-
return torch_to_bridge(t_output)
688+
return torch_to_bridge(t_output);
689689
}
690690

691691

@@ -695,11 +695,7 @@ extern "C" bridge_tensor_t threshold(
695695
float value
696696
) {
697697
auto t_input = bridge_to_torch(input);
698-
auto t_output = tnf::threshold(t_input,
699-
tnf::ThresholdFuncOptions()
700-
.threshold(threshold)
701-
.value(value));
702-
698+
auto t_output = tnf::threshold(t_input,tnf::ThresholdFuncOptions(threshold,value));
703699
return torch_to_bridge(t_output);
704700
}
705701

@@ -713,7 +709,7 @@ extern "C" bridge_tensor_t celu(
713709
tnf::CELUFuncOptions()
714710
.alpha(alpha));
715711

716-
return t_output;
712+
return torch_to_bridge(t_output);
717713
}
718714

719715

@@ -772,7 +768,7 @@ extern "C" bridge_tensor_t dropout(
772768
bool training
773769
) {
774770
auto t_input = bridge_to_torch(input);
775-
auto t_output = tnf::dropout(
771+
auto t_output = tnf::dropout(t_input,
776772
tnf::DropoutFuncOptions()
777773
.p(p)
778774
.training(training));
@@ -787,7 +783,7 @@ extern "C" bridge_tensor_t alpha_dropout(
787783
bool training
788784
) {
789785
auto t_input = bridge_to_torch(input);
790-
auto t_output = tnf::alpha_dropout(
786+
auto t_output = tnf::alpha_dropout(t_input,
791787
tnf::AlphaDropoutFuncOptions()
792788
.p(p)
793789
.training(training));
@@ -802,7 +798,7 @@ extern "C" bridge_tensor_t feature_alpha_dropout(
802798
bool training
803799
) {
804800
auto t_input = bridge_to_torch(input);
805-
auto t_output = tnf::feature_alpha_dropout(
801+
auto t_output = tnf::feature_alpha_dropout(t_input,
806802
tnf::FeatureAlphaDropoutFuncOptions()
807803
.p(p)
808804
.training(training));
@@ -817,7 +813,7 @@ extern "C" bridge_tensor_t dropout2d(
817813
bool training
818814
) {
819815
auto t_input = bridge_to_torch(input);
820-
auto t_output = tnf::dropout2d(
816+
auto t_output = tnf::dropout2d(t_input,
821817
tnf::Dropout2dFuncOptions()
822818
.p(p)
823819
.training(training));
@@ -832,7 +828,7 @@ extern "C" bridge_tensor_t dropout3d(
832828
bool training
833829
) {
834830
auto t_input = bridge_to_torch(input);
835-
auto t_output = tnf::dropout3d(
831+
auto t_output = tnf::dropout3d(t_input,
836832
tnf::Dropout3dFuncOptions()
837833
.p(p)
838834
.training(training));

lib/Bridge.chpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ module Bridge {
263263
) : bridge_tensor_t;
264264

265265
extern proc softmax(
266-
in input : bridge tensor_t,
266+
in input : bridge_tensor_t,
267267
param dim : int(64)
268268
) : bridge_tensor_t;
269269

lib/NDArray.chpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2600,7 +2600,7 @@ proc ndarray.dropout(p : real = 0.5, training : bool = false) {
26002600
:rtype: ndarray(rank, eltType)
26012601
*/
26022602
proc ndarray.alphaDropout(p : real = 0.5, training : bool = false) {
2603-
return Bridge.alphaDroput(
2603+
return Bridge.alphaDropout(
26042604
this : Bridge.tensorHandle(eltType),
26052605
p, training
26062606
) : ndarray(rank, eltType);

0 commit comments

Comments
 (0)