Home
last modified time | relevance | path

Searched refs:sens (Results 1 – 25 of 147) sorted by relevance

123456

/third_party/selinux/libsepol/include/sepol/policydb/
Dmls_types.h45 uint32_t sens; /* sensitivity */ member
55 if (r1->level[1].sens < r2->level[0].sens || r2->level[1].sens < r1->level[0].sens) { in mls_range_glblub()
61 dst->level[0].sens = MAX(r1->level[0].sens, r2->level[0].sens); in mls_range_glblub()
63 dst->level[1].sens = MIN(r1->level[1].sens, r2->level[1].sens); in mls_range_glblub()
80 dst->sens = src->sens; in mls_level_cpy()
104 return ((l1->sens == l2->sens) && ebitmap_cmp(&l1->cat, &l2->cat)); in mls_level_eq()
109 return ((l1->sens >= l2->sens) && ebitmap_contains(&l1->cat, &l2->cat)); in mls_level_dom()
165 uint32_t sens; member
Dcontext.h62 dst->range.level[0].sens = src->range.level[0].sens; in mls_context_cpy_low()
67 dst->range.level[1].sens = src->range.level[0].sens; in mls_context_cpy_low()
82 dst->range.level[0].sens = src->range.level[1].sens; in mls_context_cpy_high()
87 dst->range.level[1].sens = src->range.level[1].sens; in mls_context_cpy_high()
/third_party/mindspore/tests/ut/python/pynative_mode/
Dtest_user_define_bprop_check.py45 def construct(self, x, sens): argument
46 return grad_all_with_sens(self.net)(x, sens)
49 sens = Tensor(np.array([[1.0, 2.0, 0.0], [0.0, 3.0, 4.0]], dtype=np.float32))
53 ret = grad_net(x, sens)
77 def construct(self, x, sens): argument
78 return grad_all_with_sens(self.net)(x, sens)
81 sens = Tensor(np.array([[1.0, 2.0, 0.0], [0.0, 3.0, 4.0]], dtype=np.float32))
85 ret = grad_net(x, sens)
109 def construct(self, x, sens): argument
110 return grad_all_with_sens(self.net)(x, sens)
[all …]
Dtest_implicit_conversion.py146 def construct(self, x, y, sens): argument
147 return grad_all_with_sens(self.net)(x, y, sens)
151 sens = Tensor(np.array([[1.0, 2.0, 0.0], [0.0, 3.0, 4.0]], dtype=np.float32))
154 ret = grad_net(x, y, sens)
157 assert (ret[0].asnumpy() == sens.asnumpy()).all()
158 assert (ret[1].asnumpy() == sens.asnumpy().astype(np.bool_)).all()
174 def construct(self, x, y, sens): argument
175 return grad_all_with_sens(self.net)(x, y, sens)
179 sens = Tensor(np.array([[1.0, 2.0, 0.0], [0.0, 3.0, 4.0]], dtype=np.float32))
182 ret = grad_net(x, y, sens)
[all …]
Dtest_multi_grad.py97 sens = Tensor(np.ones([32]), dtype=mstype.float32)
104 grad_mul(x, y, sens)
105 grad_add(x, y, sens)
130 sens = Tensor(np.ones([32]), dtype=mstype.float32)
137 grad_mul(x, y, sens)
138 grad_add(x, y, sens)
165 sens = Tensor(np.ones([32]), dtype=mstype.float32)
172 grad_mul(x, y, sens)
173 grad_add(x, y, sens)
203 sens = Tensor(np.ones([32]), dtype=mstype.float32)
[all …]
Dtest_kw_and_kwarg.py79 sens = Tensor(np.ones([1, 2, 3], np.float64))
87 ret_grad = grad_kw_net(x, y, z, u=u, v=v, w=w, sens=sens)
117 def construct(self, x, y, z, sens): argument
118 return self.grad_all_wit_sense(self.net)(x, y, z, sens)
124 sens = Tensor(np.ones([1, 2, 3], np.float32))
132 ret_grad = grad_net(x, y, z, sens)
/third_party/mindspore/tests/ut/python/pynative_mode/ops/
Dtest_grad.py61 sens = Tensor(np.ones_like(out.asnumpy()))
62 args = [input_tensor, sens]
82 sens = Tensor(np.ones_like(out.asnumpy()))
83 args = [input_x, sens]
102 sens = Tensor(np.ones_like(out.asnumpy()))
103 args = [input_tensor, sens]
121 sens = Tensor(np.ones_like(out.asnumpy()))
122 args = [input_tensor, sens]
141 sens = Tensor(np.ones_like(out.asnumpy()).astype(np.float32))
142 args = [cond, x, y, sens]
[all …]
/third_party/mindspore/tests/ut/python/parameter_feature/
Dtest_var_grad.py47 sens = Tensor(np.random.normal(0, 1, [3, 4, 5]).astype(np.float32))
49 _ = grad_all_with_sens(net, net.trainable_params())(x, y, sens)
77 def __init__(self, func, wrt_params, params, grad_op, sens=None): argument
86 self.sens = sens
87 if not sens is None:
88 self.sens = sens if isinstance(sens, Tensor) else Tensor(sens, dtype=mstype.float32)
95 return self.grad(self.func, self.params)(*inputs, self.sens)
99 return self.grad(self.func)(*inputs, self.sens)
118 sens = Tensor(np.ones([3, 4, 5]), dtype=mstype.float32)
121 _ = grad_net(x, y, sens)
[all …]
/third_party/mindspore/mindspore/nn/wrap/
Dcell_wrapper.py166 def __init__(self, network, loss_fn=None, sens=None): argument
171 self.grad = C.GradOperation(get_by_list=True, sens_param=(sens is not None))
172 self.sens = sens
181 if self.sens is None:
184 grads = self.grad(self.network_with_loss, weights)(*inputs, self.sens)
335 def __init__(self, network, optimizer, sens=1.0): argument
342 self.sens = sens
354 sens = F.fill(loss.dtype, loss.shape, self.sens)
355 grads = self.grad(self.network, self.weights)(*inputs, sens)
504 def __init__(self, network, optimizer, sens=1.0): argument
[all …]
/third_party/mindspore/tests/mindspore_test_framework/utils/
Dbprop_util.py30 def __init__(self, func, wrt_params, params, grad_op, sens): argument
38 self.sens = sens
40 if sens is not None:
47 return self.grad(self.func, self.params)(*inputs, self.sens)
51 return self.grad(self.func)(*inputs, self.sens)
/third_party/selinux/libsepol/src/
Dmls.c124 p_sens_val_to_name[context->range.level[l].sens - in mls_compute_context_len()
188 sens - 1]); in mls_sid_to_context()
191 p_sens_val_to_name[context->range.level[l].sens - in mls_sid_to_context()
280 if (!c->range.level[l].sens in mls_context_isvalid()
281 || c->range.level[l].sens > p->p_levels.nprim) in mls_context_isvalid()
284 key = p->p_sens_val_to_name[c->range.level[l].sens - 1]; in mls_context_isvalid()
363 context->range.level[l].sens = levdatum->level->sens; in mls_context_to_sid()
460 dst->range.level[l].sens = src->range.level[l].sens; in mls_copy_context()
480 dst->range.level[l].sens = src->range.level[0].sens; in mls_scopy_context()
499 context->range.level[l].sens = range->level[l].sens; in mls_range_set()
[all …]
/third_party/mindspore/tests/st/fl/cross_silo_lenet/src/
Dcell_wrapper.py24 def __init__(self, network, optimizer, sens=1.0, batch_size=32): argument
25 super(TrainOneStepCellForFLWorker, self).__init__(network, optimizer, sens)
37 sens = F.fill(loss.dtype, loss.shape, self.sens)
38 grads = self.grad(self.network, self.weights)(*inputs, sens)
/third_party/mindspore/tests/
Dtrain_step_wrap.py67 def __init__(self, network, sens): argument
75 self.sens = sens
79 grads = self.grad(self.network, weights)(x, self.sens)
83 def train_step_with_sens(network, sens): argument
84 return TrainStepWrap2(network, sens)
Dops_common.py43 def construct1(self, x1, sens): argument
44 return self.grad(self.network)(x1, sens)
46 def construct2(self, x1, x2, sens): argument
47 return self.grad(self.network)(x1, x2, sens)
49 def construct3(self, x1, x2, x3, sens): argument
50 return self.grad(self.network)(x1, x2, x3, sens)
52 def construct4(self, x1, x2, x3, x4, sens): argument
53 return self.grad(self.network)(x1, x2, x3, x4, sens)
55 def construct5(self, x1, x2, x3, x4, x5, sens): argument
56 return self.grad(self.network)(x1, x2, x3, x4, x5, sens)
[all …]
/third_party/mindspore/tests/ut/python/pipeline/parse/
Dtest_sequence_assign.py196 def construct(self, x, sens): argument
197 return self.grad_all_with_sens(self.net)(x, sens)
202 sens = Tensor(np.arange(2 * 3).reshape(2, 3))
203 grad_net(x, sens)
224 def construct(self, x, value, sens): argument
225 return self.grad_all_with_sens(self.net)(x, value, sens)
231 sens = Tensor(np.arange(2 * 3).reshape(2, 3))
232 grad_net(x, value, sens)
/third_party/mindspore/tests/ut/python/parallel/
Dtest_dataset_interface.py113 def construct(self, data, sens): argument
116 grads = self.grad(self.network, weights)(data, sens)
121 def loss_scale_manager_sens(strategy1, sens): argument
132 train_net(predict, sens)
137 sens = Tensor(np.ones([256, 1024]), dtype=ms.float32)
139 loss_scale_manager_sens(strategy1, sens)
150 sens = Tensor(np.ones([256, 256]), dtype=ms.float32)
151 loss_scale_manager_sens(strategy1, sens)
Dtest_semi_auto_two_subgraphs.py68 def __init__(self, network, sens=1000.0): argument
84 loss_scale=sens)
90 self.sens = sens
98 sens_w = P.Fill()(P.DType()(loss_w), P.Shape()(loss_w), self.sens)
99 sens_d = P.Fill()(P.DType()(loss_d), P.Shape()(loss_d), self.sens)
/third_party/mindspore/mindspore/boost/
Dgrad_freeze.py133 …def __init__(self, net, sens, grad, grad_reducer, use_grad_accumulation, optimizer, max_accumulati… argument
140 self.sens = sens
149 sens = F.fill(loss.dtype, loss.shape, self.sens)
150 grads = self.grad(self.net, self.parameters)(*inputs, sens)
251 def freeze_cell(reducer_flag, network, optimizer, sens, grad, use_grad_accumulation, mean=None, deg… argument
258 freeze_nets = tuple(_TrainFreezeCell(network, sens, grad, reducer,
262 freeze_nets = tuple(_TrainFreezeCell(network, sens, grad, F.identity,
Dboost_cell_wrapper.py137 def __init__(self, network, optimizer, sens=1.0): argument
138 super(BoostTrainOneStepCell, self).__init__(network, optimizer, sens)
164 … self.freeze_nets = freeze_cell(self.reducer_flag, self.network, self.optimizer, self.sens,
199 sens = F.fill(loss.dtype, loss.shape, self.sens)
200 grads = self.grad(self.network, self.weights)(*inputs, sens)
351 super(BoostTrainOneStepWithLossScaleCell, self).__init__(network, optimizer, sens=None)
396 def _set_sense_scale(self, sens): argument
404 if self.scale_sense and isinstance(sens, Tensor):
405 self.scale_sense.set_data(sens)
407 raise TypeError("The input type must be Tensor, but got {}".format(type(sens)))
/third_party/mindspore/tests/st/fl/hybrid_lenet/src/
Dcell_wrapper.py78 def __init__(self, network, optimizer, sens=1.0): argument
86 self.sens = sens
156 sens = P.Fill()(P.DType()(loss), P.Shape()(loss), self.sens)
157 grads = self.grad(self.network, weights)(*inputs, sens)
/third_party/mindspore/tests/st/ops/ascend/
Dtest_dense_grad.py48 sens = np.random.randn(32, 1001).astype(np.float32)
50 output = net(Tensor(x), Tensor(sens))
55 sens = np.random.randn(2, 32, 1001).astype(np.float32)
57 output = net(Tensor(x), Tensor(sens))
/third_party/mindspore/tests/perf_test/
Dtest_lenet.py47 def construct(self, x, sens): argument
48 grad_op = self.grad_op(self.network)(x, sens)
72 sens = Tensor(np.ones([batch_size, num_class]).astype(np.float32))
75 _cell_graph_executor.compile(grad_op, inp, sens)
/third_party/mindspore/tests/ut/python/keep_order/
Dtest_keep_order.py69 def construct(self, x, y, sens): argument
72 dx = grad_s(self.func)(x, y, sens)
97 sens = Tensor(np.ones([3, 3]).astype(np.float32))
99 _ = net(x, y, sens)
110 def construct(self, x, y, sens): argument
114 dx = grad_s(self.func)(x, y, sens)
132 sens = Tensor(np.ones([3, 3]).astype(np.float32))
134 _ = net(x, y, sens)
/third_party/mindspore/tests/st/gnn/
Dtest_gnn_aggregator.py39 def construct(self, x, sens): argument
40 grad_op = self.grad_op(self.network)(x, sens)
55 sens = Tensor(np.ones([32, 64]).astype(np.float32))
57 _cell_graph_executor.compile(grad_op, input_data, sens)
/third_party/mindspore/tests/st/ops/gpu/
Dtest_kl_div_op.py59 def construct(self, x1, x2, sens): argument
60 gout = self.grad(self.network)(x1, x2, sens)
71 sens = np.random.rand(20).astype(np.float32)
73 dx = grad(Tensor(prediction), Tensor(target), Tensor(sens))

123456