MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / ParseAttributes

Function ParseAttributes

tensorflow/core/kernels/dilation_ops.cc:43–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41typedef Eigen::GpuDevice GPUDevice;
42
43void ParseAttributes(OpKernelConstruction* context, std::vector<int32>* strides,
44 std::vector<int32>* rates, Padding* padding) {
45 OP_REQUIRES_OK(context, context->GetAttr("strides", strides));
46 OP_REQUIRES(context, strides->size() == 4,
47 errors::InvalidArgument("Sliding window stride field must "
48 "specify 4 dimensions"));
49 OP_REQUIRES(context, (*strides)[0] == 1 && (*strides)[3] == 1,
50 errors::Unimplemented(
51 "Stride is only supported across spatial dimensions."));
52
53 OP_REQUIRES_OK(context, context->GetAttr("rates", rates));
54 OP_REQUIRES(context, rates->size() == 4,
55 errors::InvalidArgument("Input stride (atrous rate) field "
56 "must specify 4 dimensions"));
57 OP_REQUIRES(context, (*rates)[0] == 1 && (*rates)[3] == 1,
58 errors::Unimplemented(
59 "Rate is only supported across spatial dimensions."));
60
61 OP_REQUIRES_OK(context, context->GetAttr("padding", padding));
62}
63
64void ParseSizes(OpKernelContext* context, const std::vector<int32>& strides,
65 const std::vector<int32>& rates, const Padding& padding,

Callers 6

ParseHloModuleMethod · 0.85
ParseInstructionRhsMethod · 0.85
DilationOpMethod · 0.85

Calls 4

InvalidArgumentFunction · 0.85
UnimplementedFunction · 0.85
GetAttrMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected