Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion ravpy/distributed/compute.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ def compute_locally_bm(*args, **kwargs):
def compute_locally(payload, subgraph_id, graph_id):
try:
# print("Computing ",payload["operator"])
# print('\n\nPAYLOAD: ',payload)
# print('\n\nPAYLOAD: ',payload['operator'])


values = []

Expand Down Expand Up @@ -273,6 +274,8 @@ def get_unary_result(value1, params, operator):
result = forward_pass_flatten(value1, params=params)
elif operator == "backward_pass_flatten":
result = backward_pass_flatten(value1, params=params)
elif operator == "get_layer_result":
result = get_layer_result(value1, params=params)

return result

Expand Down
6 changes: 5 additions & 1 deletion ravpy/distributed/op_functions/dl_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -593,4 +593,8 @@ def backward_pass_flatten(accum_grad, params=None):#prev_input=None, input_layer
backward_pass_output = {
'accum_grad': accum_grad.reshape(prev_shape).tolist()
}
return backward_pass_output
return backward_pass_output

def get_layer_result(X,params=None):
result=np.array(X['result'])
return result.tolist()
2 changes: 2 additions & 0 deletions ravpy/strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ class Operators(object):
ONE_HOT_ENCODING = "one_hot_encoding"
SET_VALUE = "set_value"
SQUEEZE = "squeeze"
GET_LAYER_RESULTS="get_layer_result"

# Machine Learning Ops
LINEAR_REGRESSION = "linear_regression"
Expand Down Expand Up @@ -278,6 +279,7 @@ class TFJSOperators(object):
'federated_mean': Operators.FEDERATED_MEAN,
'federated_variance': Operators.FEDERATED_VARIANCE,
'federated_standard_deviation': Operators.FEDERATED_STANDARD_DEVIATION,
'get_layer_result':Operators.GET_LAYER_RESULTS,
}


Expand Down