in shell scripting there is extensive usage of
i> regular expression
ii>sed
iii>awk
can anyone tell me the suitable contexts ...i mean which one is suitable for what kind of operation.
like the reg-exp and sed seems to be doing the same job..i.e pattern matching (1 Reply)
$ cat file.txt
asd
<AA>dev
<LL>def
<RR>sha
This works for me:
$ sed -r 's/^ .*<LL>def/\t<LL>my/' file.txt
asd
<AA>dev
<LL>my
<RR>sha
But, this does not work for me:
$ sed -r 's/^\s+<LL>def/\t<LL>my/' file.txt
asd
... (1 Reply)
Hi, I need
to make some extraction . with the following input to get the right output.
input: /etc/exp/home/bin ====> output: exp
and
input: aex1234 ===> output: ex
Thanks for your help, (4 Replies)
Hi,
I am using the following piece of code for extracting some data from in between some tags ...
$text =~ /<TAG1>(.*)<\/TAG1>.*<TAG2>(.*)<\/TAG2>.*<TAG3>(.*)<\/TAG4>.*<TAG5>(.*)<\/TAG5>/;
$tag1=$1;
print "\n$tag1";
But I am getting an error like
Use of uninitialized value in... (1 Reply)
$var1="LEN";
$VAR2="CODLENTT";
now, var2 contains var1(LEN).How do i check this in perl....
whether one string is a part of another..?
if (<logic>)
{
my operation;
}
what'd be the logic.. (4 Replies)
Respected All,
I have a very big xml in that i want to search only below 3 lines.
<target name ="UpgradePrimaryBox" depends ="configureBox1">
<echo> Finished Upgrading Primary Box </echo>
</target>
grep -i "<target.*UpgradePrimaryBox" this gives me the first line.
then i need to match... (7 Replies)
Hi all,
is there anyone good at bash who will help me?
I need to use syntax ${string/pattern/replacement}
The problematic part where I am stuck is:
#!bin/bash
text="A cat is on a mat."
exp="cat"
newexp="SOMECODEcatSOMECODE"
newtext=${${text}/${exp}/${newexp}}
== > ERROR "wrong... (4 Replies)
Hi Unix Gurus,
yesterday I asked a question and got answer, it works fine.
I have one more thing need to help
in the code
awk '{print substr($0,1,3)"xxx"substr($0,7)}' file
If I have 50 charactor's need to be replaced, is there any easy way to use reg exp or I have to input 50 XXXXx......... (12 Replies)
Discussion started by: ken6503
12 Replies
LEARN ABOUT MOJAVE
mpsnndefaultpadding
MPSNNDefaultPadding(3) MetalPerformanceShaders.framework MPSNNDefaultPadding(3)NAME
MPSNNDefaultPadding
SYNOPSIS
#import <MPSNeuralNetworkTypes.h>
Inherits NSObject, and <MPSNNPadding>.
Instance Methods
(NSString *__nonnull) - label
Class Methods
(instancetype __nonnull) + paddingWithMethod:
(instancetype __nonnull) + paddingForTensorflowAveragePooling
(instancetype __nonnull) + paddingForTensorflowAveragePoolingValidOnly
Method Documentation
- (NSString * __nonnull) label
Human readable description of what the padding policy does
+ (instancetype __nonnull) paddingForTensorflowAveragePooling
A padding policy that attempts to reproduce TensorFlow behavior for average pooling Most TensorFlow padding is covered by the standard
MPSNNPaddingMethod encodings. You can use +paddingWithMethod to get quick access to MPSNNPadding objects, when default filter behavior
isn't enough. (It often is.) However, the edging for max pooling in TensorFlow is a bit unusual.
This padding method attempts to reproduce TensorFlow padding for average pooling. In addition to setting MPSNNPaddingMethodSizeSame |
MPSNNPaddingMethodAlignCentered | MPSNNPaddingMethodAddRemainderToBottomRight, it also configures the filter to run with
MPSImageEdgeModeClamp, which (as a special case for average pooling only), normalizes the sum of contributing samples to the area of valid
contributing pixels only.
// Sample implementation for the tensorflowPoolingPaddingPolicy returned
-(MPSNNPaddingMethod) paddingMethod{ return MPSNNPaddingMethodCustom | MPSNNPaddingMethodSizeSame; }
-(MPSImageDescriptor * __nonnull) destinationImageDescriptorForSourceImages: (NSArray <MPSImage *> *__nonnull) sourceImages
sourceStates: (NSArray <MPSState *> * __nullable) sourceStates
forKernel: (MPSKernel * __nonnull) kernel
suggestedDescriptor: (MPSImageDescriptor * __nonnull) inDescriptor
{
((MPSCNNKernel *)kernel).edgeMode = MPSImageEdgeModeClamp;
return inDescriptor;
}
+ (instancetype __nonnull) paddingForTensorflowAveragePoolingValidOnly
Typical pooling padding policy for valid only mode
+ (instancetype __nonnull) paddingWithMethod: (MPSNNPaddingMethod) method
Fetch a well known object that implements a non-custom padding method For custom padding methods, you will need to implement an object
that conforms to the full MPSNNPadding protocol, including NSSecureCoding.
Parameters:
method A MPSNNPaddingMethod
Returns:
An object that implements <MPSNNPadding> for use with MPSNNGraphNodes.
Author
Generated automatically by Doxygen for MetalPerformanceShaders.framework from the source code.
Version MetalPerformanceShaders-100 Thu Feb 8 2018 MPSNNDefaultPadding(3)